.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Articles >> ASP.NET >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Random Password Generator

Posted By:Gowthammanju       Posted Date: June 04, 2011    Points: 200    Category: ASP.NET    URL: http://www.dotnetspark.com  

This creates the automatic passwords which includes text,numbers and syambol


   This projects explain about the generation of random password genarator

It said to posses various steps such as,

1)Creation of lable in aspx page

2)copy and paste the below code

3)run it find solution

protected void Page_Load(object sender, EventArgs e)
        Label1.Text = RandomString(8);
    private string RandomString(int StrLength)
        string CharsList = "abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        char[] chars = CharsList.ToCharArray();

        RNGCryptoServiceProvider cryptoGen = new RNGCryptoServiceProvider();
        byte[] ByteData = new byte[StrLength];

        StringBuilder ResultStr = new StringBuilder();
        foreach (byte byt in ByteData)
            ResultStr.Append(chars[byt % chars.Length]);
        return ResultStr.ToString();

 Subscribe to Articles


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend