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:
'VB.Net - Array.IndexOf Method:
'Searches for the specified object and returns the index
'of the first occurrence within the entire one-dimensional
Dim i%, j%, k%
Dim blnExist As Boolean
For i = 0 To 6
blnExist = False
Do While blnExist = False
j = Int(35 * Rnd() + 1)
For k = 0 To UBound(lotto)
If lotto(k) = j Then
blnExist = True
Exit For
End If
Next k
Loop
lotto(i) = j
Next i
End Sub