generate 5 digit random number in c#

sam
sam
134 Points
62 Posts

Hi,

how to generate 5 digit random number in c#?

Views: 8201
Total Answered: 1
Total Marked As Answer: 1
Posted On: 03-Jul-2015 05:04

Share:   fb twitter linkedin
Answers
Rahul Maurya
Rahul M...
Moderator
1172 Points
211 Posts
         

Hi sam,

Use Random class as: 

 
string Randomstring = ""; 
Random random = new Random();
Randomstring= random.Next(10000, 99999).ToString("00000");
 
Posted On: 03-Jul-2015 09:41
 Log In to Chat