Search This Blog

Saturday 25 June 2016

Generate four digit random number in ASP.Net Or Generate random number in ASP.Net

Random random = new Random();
string randomvalue = random.Next(1, 10000).ToString();

Note:-

If you need more than four digit, add one more “0” in highlighted digit.

2 comments: