Random number in asp
---------------------------------------------------------
Function getRandomnum()
Randomize
dim randomVar1, randomVar2, randomVar3, currDate
currDate = Replace(Now(), "/", "")
currDate = Replace(currDate, " ", "")
currDate = Replace(currDate, ":", "")
currDate = Replace(currDate, "AM", "")
currDate = Replace(currDate, "PM", "")
randomVar1 = (Rnd() * 1000000)
randomVar2 = Sqr(randomVar1)
randomVar3 = Round(1000000 * (randomVar1 * randomVar2))
getRandomnum = (currDate & randomVar3)
End Function
---------------------------------------------------------
Function getRandomnum()
Randomize
dim randomVar1, randomVar2, randomVar3, currDate
currDate = Replace(Now(), "/", "")
currDate = Replace(currDate, " ", "")
currDate = Replace(currDate, ":", "")
currDate = Replace(currDate, "AM", "")
currDate = Replace(currDate, "PM", "")
randomVar1 = (Rnd() * 1000000)
randomVar2 = Sqr(randomVar1)
randomVar3 = Round(1000000 * (randomVar1 * randomVar2))
getRandomnum = (currDate & randomVar3)
End Function
No comments:
Post a Comment