If statement
-
Hello, I have couple of question about if statement. When I create password verifying program, at least 8 characters long is if (password.Length < 8) valid = false; like this, right? Then, how can I make program that must contain at least one digit and one uppercase for the password. Then, I tried to create while (valid && i < 1) { if (!Char.IsLetter(custID[i])) valid = false; i++; } like this, but it's not working. Please tell me.
-
Hello, I have couple of question about if statement. When I create password verifying program, at least 8 characters long is if (password.Length < 8) valid = false; like this, right? Then, how can I make program that must contain at least one digit and one uppercase for the password. Then, I tried to create while (valid && i < 1) { if (!Char.IsLetter(custID[i])) valid = false; i++; } like this, but it's not working. Please tell me.
Look into String.IndexOfAny http://msdn.microsoft.com/en-us/library/11w09h50.aspx[^]
-
Hello, I have couple of question about if statement. When I create password verifying program, at least 8 characters long is if (password.Length < 8) valid = false; like this, right? Then, how can I make program that must contain at least one digit and one uppercase for the password. Then, I tried to create while (valid && i < 1) { if (!Char.IsLetter(custID[i])) valid = false; i++; } like this, but it's not working. Please tell me.
You should be able to figure something out from the following Password Strength Control Regular expressions can help but they're not a silver bullet.
Q. Hey man! have you sorted out the finite soup machine? A. Why yes, it's celery or tomato.
-
You should be able to figure something out from the following Password Strength Control Regular expressions can help but they're not a silver bullet.
Q. Hey man! have you sorted out the finite soup machine? A. Why yes, it's celery or tomato.
You need to read his earlier post. It's homework.
-
Hello, I have couple of question about if statement. When I create password verifying program, at least 8 characters long is if (password.Length < 8) valid = false; like this, right? Then, how can I make program that must contain at least one digit and one uppercase for the password. Then, I tried to create while (valid && i < 1) { if (!Char.IsLetter(custID[i])) valid = false; i++; } like this, but it's not working. Please tell me.
hi . if(password.Length < 8) is extreme 7 character. at least 8 character is this :
if(7
but for second part of your question ... ! try to understand these codes and get some idea to mke your own .never copy and paste!(just a suggestion to improve your skills,ofcourse you are free to copy :) )
char[] Digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
if (7 < password.Length)
foreach (char t in Digits)
if (password.Contains(t))
for (int h = 65; h < 90; h++)
if (password.Contains((char)h))
break;//do proper operation ... . -
You need to read his earlier post. It's homework.
-
hi . if(password.Length < 8) is extreme 7 character. at least 8 character is this :
if(7
but for second part of your question ... ! try to understand these codes and get some idea to mke your own .never copy and paste!(just a suggestion to improve your skills,ofcourse you are free to copy :) )
char[] Digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9' };
if (7 < password.Length)
foreach (char t in Digits)
if (password.Contains(t))
for (int h = 65; h < 90; h++)
if (password.Contains((char)h))
break;//do proper operation ... . -
yea , its more simple way . thanks for remind!