I am trying to use WinSCP using Visual Studio. I am able to login to the remote machine using my own credentials using the WinSCP code. After login, I would need to do a sudo user to move another file.
How to connect to a different user within WinSCP?
My current code is like this:
Session session = null;
try
{
// Setup session options
SessionOptions sessionOptions = new SessionOptions
{
Protocol = Protocol.Ftp,
HostName = HostName,
UserName = UserName,
Password = Password,
Timeout = TimeSpan.FromDays(1),
};
using (session = new Session())
{
// Connect
session.Open(sessionOptions);