Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 13196 |  Welcome, Guest!   Register  Login
 Home > Forums > ASP.NET > how do generate unique alpha numeric random number in asp.net ...
Kannan1986

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

Replies: 2 | Posted by: Kannan1986 on 2/4/2010 | Category: ASP.NET Forums | Views: 6987 | Status: [Member]  


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


Reply | Reply with attachment | Alert Moderator

 Responses below this adGet hundreds of .NET Tips and Tricks videos

 Replies

Poster
Poster  
Posted on: 2/4/2010 7:46:49 AM
Level: Starter | Status: [Member]

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. | Reply | Alert Moderator 

Nishithraj
Nishithraj  
Posted on: 2/24/2010 10:02:41 AM
Level: Bronze | Status: [Member]

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. | Reply | Alert Moderator 

Reply - Please login to reply


Click here to login & reply

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/20/2013 12:34:29 AM