For one of my sites (Eeliz.com) I needed to randomly position an image either left or right. For this I used the following random number function :

Public Function RandomNum(ByVal MaxNum As Integer, _
Optional ByVal MinNum As Integer = 0) As Integer

‘initialise the number generator
Dim r As New Random(System.DateTime.Now.Millisecond)

’some validation on the values passed in
‘on exception will return 0
Read the rest of this entry »