Tôi có thể xác định máy chủ proxy bằng cách sử dụng GUI WinSCP. Nếu tôi làm điều này tôi có thể kết nối với một máy chủ từ xa. Nhưng trong mã tôi không tìm thấy một cách để khai báo máy chủ proxy cho WinSCP.Hội đồng WinSCP .NET: Nơi để xác định proxy?
Trong trường hợp này tôi nhận
từ xa máy chủ trả về một lỗi (407) xác thực Proxy yêu cầu.
Mã của tôi:
SessionOptions sessionOptions = new SessionOptions
{
Protocol = protocol,
HostName = hostname,
UserName = user,
Password = pass,
PortNumber = portnumber
};
using (Session session = new Session())
{
session.ExecutablePath = @"C:\Program Files (x86)\WinSCP\WinSCP.exe";
session.Open(sessionOptions);
TransferOptions options = new TransferOptions();
options.FileMask = mask;
SynchronizationResult synchronizationResult;
synchronizationResult =
session.SynchronizeDirectories(mode, local, path, deletefiles, options: options);
synchronizationResult.Check();
}
Loại proxy nào? Không giống như một proxy vớ ... – arkascha