Wednesday, 25 June 2014

Generate Random no.(PASSWORD)

       string v = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
        Random ran = new Random();
        int length = 5;
        string res = "";
        while (0 < length--)
        {
            res += v[ran.Next(v.Length)];
        }
        TextBox6.Text = res;

No comments:

Post a Comment