1.问题...这是我的密码验证。CONsoleApp 但我有错误...如果第一个空格是空程序工作(...但是如果第一个字符是白色,我想返回 false
2.Many Condition using I want some using condition..我想练习好方法
{
bool symb = false;
bool letdig = false;
char currentchar;
char currentchar2;
if (!(pass.Length >= 8 && pass.Length <= 25))
{
return true;
}
string symbols = "!@#$%^&*()_-+=[{]};:<>|./?.";
char[] simbolchar = symbols.ToCharArray();
for (int j = 0; j < pass.Length; j++)
{
currentchar = pass[j];
foreach (var simb in simbolchar)
{
if (simb == currentchar)
{
symb = true;
}
}
if (symb)
{
for (int i = 0; i < pass.Length; i++)
{
currentchar2 = pass[i];
if (char.IsUpper(currentchar2) && (char.IsLetterOrDigit(currentchar2)))
{
letdig = true;
}
}
}
if (letdig)
{
Console.WriteLine("WELCOME");
return true;
}
}
return letdig;
}