Question Ideas on validating an auto generated code within 24 hours..

guysoul

Member
Joined
Jun 29, 2011
Messages
5
Location
Halden, Norway
Programming Experience
3-5
Hi guys,

Im new to vb.net. Hope someone can help with a script. :)

I created a vb.net script to autogenerate a code. Now, after generating this code, what I want is to determine the validity of this code. for example, a code has been generated now and this code will be valid for 24 hours only. Can someone help me how to do this? i have no idea as of this moment. Been searching over google and dont know what's the right keyword for that.. :) Below is my script for the auto generation code

Dim randomvalue As New Random
Dim randomhold As Integer
Dim newcode As Long

For i As Integer = 0 To 9999
randomhold = randomvalue.Next(1, 9999)
newcode = randomhold & DateTime.Now.Minute & DateTime.Now.Year
Label3.Text = newcode
Next

Thank you and have a great day guys.. :)

Ed
 
Unless the code itself contains its expiration date then you have to record the code and its expiration date somewhere else. It doesn;t have to be a database but it has to be somewhere.
 
Back
Top