Hi friends,
I am making a project on cyber cafe and i want to generate username and password automatically on different clicks.

I am using txtusername.text=cstr(int(rnd()*1000))
It gives random numbers but in a same sequence like
whenever i run and click on generate button it shows
973
again click
950
again click
939
but when i close my programme and again running programme then same sequence starting from 973
973
again click
950
again click
939
so i want codes for generating random string or integer without repeating sequence after programme closing again and again

thanks
pardeep

Add a call to Randomize() before the process that begins the creation of the random numeric string. Example:

Randomize()

        For i As Integer = 0 To 10
            Console.WriteLine(Rnd())
        Next

        Console.Read()

Without Randomize() in the above example, you would get the same 10 values if you ran the program twice. With it, you get the different results you expect.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.