I didn't test it so give it the try but in general code you posted generates random number, then it checks if current value already exists in the array and if not it will assign to current array item.
"Translated" version does pretty much the same thing:
VB Code:
  1. 'VB.Net - Array.IndexOf Method:
  2. 'Searches for the specified object and returns the index
  3. 'of the first occurrence within the entire one-dimensional
  4.  
  5. Dim i%, j%, k%
  6. Dim blnExist As Boolean
  7.  
  8.     For i = 0 To 6
  9.         blnExist = False
  10.         Do While blnExist = False
  11.             j = Int(35 * Rnd() + 1)
  12.             For k = 0 To UBound(lotto)
  13.                 If lotto(k) = j Then
  14.                     blnExist = True
  15.                     Exit For
  16.                 End If
  17.             Next k
  18.         Loop
  19.         lotto(i) = j
  20.     Next i
  21.  
  22. End Sub