This code gets a cryptographically strong random number that is 20 bytes in length, then Base64 encodes it. There's a lot of Java library code here, so your guess is as good as mine as to how to do it in VB.
SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
byte[] bytes = new byte[20];
synchronized (random) { random.nextBytes(bytes); }
return Base64.encode(bytes);
The first line creates an instance of the SecureRandom class. This class provides a cryptographically strong pseudo-random number generator.
The second line declares a byte array of length 20.
The third line reads the next 20 random bytes into the array created in line 2. It synchronizes on the SecureRandom object so that there are no conflicts from other threads that may be using the object. It's not apparent from this code why you need to do this.
The fourth line Base64 encodes the resulting byte array. This is probably for transmission, storage, or display in a known format.