What I am trying to do is ensure a Argument being passed from the command line is between a specific set of characters, however the code doesn’t seem to be highlighting any issues when a value outside the acceptable range is used.
if (args[1].Length < 10 && args[1].Length > 40) // Test to see if the password is between 10 and 40 characters
{
Console.WriteLine("Please use a password between 10 and 40 characters");
Environment.Exit(0);
}
I was wondering if anyone might have any suggestions for why this is not working.
The arguments being passed are -e password file1.txt file2.txt
Thanks in Advance!
Alistair
You have the wrong logic, should be
||