.net中,随机生成密码,用System.Guid.newguid()就可以了,
代码如下
代码如下
string alphabets = "abcdefghijklmnopqrstuvwxyz";
string numbers = "01234567890123456789012345";
StringBuilder password = new StringBuilder();
Random r = new Random();
for(int j=0; j<=20;j++)
{
for(int i=0;i<=5;i++)
{
password.Append(alphabets[r.Next(alphabets.Length)]);
password.Append(numbers[r.Next(numbers.Length)]);
}
Response.Write(password.ToString());
password.Remove(0,password.Length);
}