Генерация 10-и символьного пароля из заранее определенного массива символов:
Код:
private void button1_Click(object sender, EventArgs e)
{
Random rnd = new Random();
Char[] pwdChars = new Char[26] {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
textBox1.Text = String.Empty;
for (int i = 0; i < 10; i++)
textBox1.Text += pwdChars[rnd.Next(0, 25)];
}