Dim loRnd As New Random(CInt(DateTime.Now().Ticks And &HFFFFFFFF&))>>( Casting in C# allows unchecked conversion ; VB doesn't)
Sub Main() Static r As Random = New Random() Dim theNext As Integer Dim oldValue As Integer = r.Next() Do While True theNext = r.Next() Console.WriteLine(theNext.ToString()) If theNext = oldValue Then GoTo 100 oldValue = theNext Loop 100: End Sub