SessionOptions.SshPrivateKeyPath is set, but SessionOptions.Protocol
hi,
i'm trying to connect to ftp site using .net assembly with session option c# code generated by winscp ui, as follow
// Set up session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "xxxxxxxxxx",
PortNumber = 21,
UserName = "xxxxxx",
Password = "xxxxx",
SshPrivateKeyPath = @"C:\Program Files\WinSCP\......PPK",
FtpMode = FtpMode.Active,
TimeoutInMilliseconds = 60000,
};
sessionOptions.AddRawSettings("ProxyHost", "xxx.xxx.xxx.xxx");
sessionOptions.AddRawSettings("ProxyPort", "1080");
using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
// Your code
}
I can connect with winscp ui but i get the error
SessionOptions.SshPrivateKeyPath is set, but SessionOptions.Protocol is neither Protocol.Sftp nor Protocol.Scp.
when i use .net assembly in c# application.
Some suggestion?
thanks
i'm trying to connect to ftp site using .net assembly with session option c# code generated by winscp ui, as follow
// Set up session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = "xxxxxxxxxx",
PortNumber = 21,
UserName = "xxxxxx",
Password = "xxxxx",
SshPrivateKeyPath = @"C:\Program Files\WinSCP\......PPK",
FtpMode = FtpMode.Active,
TimeoutInMilliseconds = 60000,
};
sessionOptions.AddRawSettings("ProxyHost", "xxx.xxx.xxx.xxx");
sessionOptions.AddRawSettings("ProxyPort", "1080");
using (Session session = new Session())
{
// Connect
session.Open(sessionOptions);
// Your code
}
I can connect with winscp ui but i get the error
SessionOptions.SshPrivateKeyPath is set, but SessionOptions.Protocol is neither Protocol.Sftp nor Protocol.Scp.
when i use .net assembly in c# application.
Some suggestion?
thanks