Having trouble running from .net application
I have been using a .bat to run WinScp to download from a ftp site which works fine. The line in the .bat file is : winscp.exe /script=FMCSADownLoad.txt
FMCSADownLoad.txt reads:
open [email protected]
get *.txt
exit
A new requirement is that I put this process into the body of my .net application.
I have tried:
Process winscp = new Process();
winscp.StartInfo.FileName = "C:\\FMCSA_Upload\\winscp.com";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.RedirectStandardInput = true;
winscp.Start();
winscp.StandardInput.WriteLine("open [email protected]");
winscp.StandardInput.WriteLine("get *.txt");
winscp.StandardInput.WriteLine("exit");
This does not work. Can anyone guide me to a way to run an existing session from a .net application?
Thanks
Dave
FMCSADownLoad.txt reads:
open [email protected]
get *.txt
exit
A new requirement is that I put this process into the body of my .net application.
I have tried:
Process winscp = new Process();
winscp.StartInfo.FileName = "C:\\FMCSA_Upload\\winscp.com";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.RedirectStandardInput = true;
winscp.Start();
winscp.StandardInput.WriteLine("open [email protected]");
winscp.StandardInput.WriteLine("get *.txt");
winscp.StandardInput.WriteLine("exit");
This does not work. Can anyone guide me to a way to run an existing session from a .net application?
Thanks
Dave