I want to generate an unique 4 digit random number. This is the below code what I have tried:
Code for generating random number
//Ge
241 is a four digit number, if you use leading zeros: 0241.
Display the returned number with a format string like this:
String.Format("{0:0000}", n);