/ Published in: VB.NET
Retorna un número aleatorio entre un mÃnimo y un máximo
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Shared Function NumeroAleatorio(Optional ByVal maximo As Integer = Integer.MaxValue, Optional ByVal minimo As Integer = Integer.MinValue) As Integer Dim r As New Random(lastintegervalue) If minimo > maximo Then Dim t As Integer = minimo minimo = maximo maximo = t End If lastintegervalue = r.Next(minimo, maximo) Return lastintegervalue End Function