Copying from jon skeet's answer...
https://stackoverflow.com/a/976674/67824
Random rand = new Random();
public const string Alphabet =
"abcdefghijklmnopqrstuvwyxzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
public string GenerateString(int size)
{
char[] chars = new char[size];
for (int i=0; i < size; i++)
{
chars[i] = Alphabet[rand.Next(Alphabet.Length)];
}
return new string(chars);
}