random string generator
public string AutoGenerateString(int lenght)
{
string def = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";//0123456789";
Random rnd = new Random();
StringBuilder ret = new StringBuilder();
for (int i = 0; i < lenght; i++)
{
ret.Append(def.Substring(rnd.Next(def.Length), 1));
}
return ret.ToString();
}
0 comments:
Post a Comment