-----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:
Posts (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...
-
In C# using System; using System.Collections.Generic; using System.Linq; using System.Web; public class encode_decode { public ...
-
Design page ------------ <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inheri...