protected void Button3_Click(object sender, EventArgs e)
{
GetRandomPassword();
}
public static string GetRandomPassword(int length)
{
char[] chars = "$%#@!*abcdefghijklmnopqrstuvwxyz1234567890?;:ABCDEFGHIJKLMNOPQRSTUVWXYZ^&".ToCharArray();
string password = string.Empty;
Random random = new Random();
for (int i = 0; i < length; i++)
{
int x = random.Next(1, chars.Length);
if (!password.Contains(chars.GetValue(x).ToString()))
password += chars.GetValue(x);
else
i--;
}
return password;
}
}
Hi Everyone
This is my code i want generate random password but wt my problems is display the error is No overload for method 'GetRandomPassword' takes '0' arguments How to slove this error plz help me