Menu

#1 Example user SFTP interface compares incorrect strings

v1.0 (example)
open
nobody
5
2010-08-11
2010-08-11
Paul Atkin
No

In SshFileTransferTest the user options read mixed case text, check against lowercase but then return the mixed case before deciding what to do against lower case.

Suggest changing GetProtocol and GetTransferDirection to return the lowercase version:

public static string GetTransferDirection()
{
string dir;
while (true)
{
Console.Write("Enter transfer direction [To|From]: ");
dir = Console.ReadLine().ToLower();
if (dir.Equals(string.Empty)) break;
if (dir.Equals("to") || dir.Equals("from"))
break;
Console.Write("Bad input, ");
}
return dir;
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.