How to generate a random number in vb.net

How to generate a random number in vb.net

Function GenerateRandomNumber(iLowerRange As Integer, iUpperRange As Integer)
as integer

Dim RandomGenerator As Random
Dim intRandomNumber As Integer

RandomGenerator = New Random()

'Get the next random number
intRandomNumber = RandomGenerator.Next(iLowerRange, iUpperRange+ 1)

'Return the random # as the function's return value
return intRandomNumber

End Function