Aug 13, 2009

How to generate a random unique 5 digit number + C#

Below is the method used to generate random 5 digit number.

public int getRandomID ()


Random r = new Random()

return r.Next(10000,99999);


The number 10000, 99999 specifies the range.


Anonymous said...

I recently came accross your blog and have been reading along. I thought I would leave my first comment. I dont know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.


Anonymous said...

Cheers for the help.