-----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 ...
-
DECLARE @tablas TABLE(tableName nvarchar(100)) INSERT INTO @tablas SELECT t.TABLE_SCHEMA+ '.'+t.TABLE_NAME FROM INFORMATION_SCHEMA...
-
Design page ------------ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inheri...
-
In C# using System; using System.Collections.Generic; using System.Linq; using System.Web; public class encode_decode { public ...
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