Search
MVC Online Training
Winners

Win Prizes

Social Presence
Twitter Twitter LinkedIn YouTube Google

Like us on Facebook
Advertisements
Top Forums Author
Sun, 21-Sep-2014 Authors
All Time Authors
Jayakumars
4170
Karthikanbarasan
3455
Chvrsri
3140

Latest members | More ...


(Statistics delayed by 5 minutes)
 Forum Post

how do generate unique alpha numeric random number in asp.net

Kannan1986
Posted by Kannan1986 under ASP.NET on 2/4/2010 7:33:50 AM | Views : 30445 | Status : [Member] | Replies : 2


how do generate unique alpha numeric random number in asp.net



Posted by: Poster on: 2/4/2010 [Member] Starter

Here is the super easy way to do that. Following code snippet will give you 8 digit alphanumeric random string.

      Guid g = Guid.NewGuid();

string random = g.ToString();
Response.Write(random.Substring(0, 8));


In the 3rd line you can replace 8 with whatever number (10, 12 etc) and then you may find - that you can replace with empty string.

Please "Mark as answer", if this helped.

Thanks

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Nishithraj on: 2/24/2010 [Member] Bronze

Check
http://bytes.com/topic/c-sharp/answers/587443-generate-unique-random-string

Mark this as answer, if it is.....

With regards
Nishithraj Narayanan

Kannan1986, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response


Found interesting? Add this to: