Test your technical skills online, appear in Virtual Interview and be ready for job!
Twitter Twitter LinkedIn YouTube Google
Be Interview ready ! | Search
Make friends on DotNetFunda.com and expand your network!
Winners

Win Prizes

Announcements
Like us on Facebook
Sponsor
Top Forums Author
Wed, 23-Apr-2014 Authors
Brierust
10
Klbaiju
10
Naidulaxmi
10
All Time Authors
Jayakumars
3930
Karthikanbarasan
3455
Chvrsri
3140

Latest members | More ...


(Statistics delayed by 5 minutes)

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 : 29253 | Status : [Member] | Replies : 2
how do generate unique alpha numeric random number in asp.net



Reply | Reply with Attachment

=> Scroll below for responses


Comments or Responses

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.

Comments / Responses
Select text & click toolbar to format. Formatting appears in viewmode only. HTML Tags are not allowed.
Bold Italic Underline Paragraph Title Code  Link 
 Wait ... Processing ..... please wait.

Found interesting? Add this to: