Pages

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.

1 comment:

Anonymous said...

Cheers for the help.