-----RandomPasswordCrate.cs
public class RandomPasswordCrate
{
public static string GeneratePassword(int PasswordLength)
{
string _allowedChars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNOPQRSTUVWXYZ0123456789_";
Random randNum = new Random();
char[] chars = new char[PasswordLength];
int allowedCharCount = _allowedChars.Length;
for (int i = 0; i < PasswordLength; i++)
{
chars[i] = _allowedChars[(int)((_allowedChars.Length) * randNum.NextDouble())];
}
return new string(chars);
}
}
------In cs Page
protected void Page_Load(object sender, EventArgs e)
{
generatePassword();
}
private void generatePassword()
{
string password = "Your password is: " + RandomPasswordCrate.GeneratePassword(8);
}
Subscribe to:
Post Comments (Atom)
Get all non-clustered indexes
DECLARE cIX CURSOR FOR SELECT OBJECT_NAME(SI.Object_ID), SI.Object_ID, SI.Name, SI.Index_ID FROM Sys.Indexes SI ...
-
In C# using System; using System.Collections.Generic; using System.Linq; using System.Web; public class encode_decode { public ...
-
Create one class named RandomSNKGenerator using System; using System.Collections.Generic; using System.Linq; using System.Web; ...
-
//string regularExpressionPattern = @"\<(.*?)\>"; // FOR right angles < > //string regularExpressionPattern = @...
really this blog is very helpful for growth of knowledge...Thank You for this information...
ReplyDeletedigital image editing
ASP.net this coding for very useful for web and other ...........thnx for sharing such a good post........
ReplyDeletevacation rentals in orlando