Guest Account

G

Guest

I want to have 2 types of accounts of which users can use to login through
the site, either a user account that is created through registeration or
login as a guest.

I have no problem with the user accounts, the problem is with guest account,
I want if a user chooses to login as a guest he would be given a random 5
digit id that does not currently exist in the guests table. I don't want to
have the auto increment primary key in guests table, I want it random created
in the page and then inserted in the table.

I can't think of a solution that generates random values that guarantees
that no duplicate values would exist at the same time?

Any one can help me with an idea?

Thanks in advance.
 
J

John Timney \(ASP.NET MVP\)

Try using tickcount, I think it operates at the millisecond level which
should be unique enough.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
G

Guest

I tried something like that:
new Random().Next((int)DateTime.Now.Ticks)
is this correct?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top