class RandomString
{
Random rnd = new Random();
public char getRandomChar()
{
int ret = rnd.Next(122);
while(ret<65||(ret>90&&ret<97)||ret>122)
{
ret = rnd.Next(122);
}
return (char)ret;
}
public string getRandomString(int length)
{
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++)
{
sb.Append(getRandomChar());
}
return sb.ToString();
}
}
{
Random rnd = new Random();
public char getRandomChar()
{
int ret = rnd.Next(122);
while(ret<65||(ret>90&&ret<97)||ret>122)
{
ret = rnd.Next(122);
}
return (char)ret;
}
public string getRandomString(int length)
{
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++)
{
sb.Append(getRandomChar());
}
return sb.ToString();
}
}