Having trouble running from .net application

Advertisement

daforga
Joined:
Posts:
1

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 riviera@fileserv.fmcsa.dot.gov
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 riviera@fileserv.fmcsa.dot.gov");
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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,567
Location:
Prague, Czechia

Re: Having trouble running from .net application

Sorry, your post does not include enough information.

Please read how to troubleshoot problems with WinSCP. If it turns out that you are not able to help yourself, read how to ask for support or report bugs efficiently, so others can help you.

Anyway, these link may help you:
https://winscp.net/eng/docs/faq_scheduler
https://winscp.net/eng/docs/guide_dotnet

Reply with quote

Advertisement

You can post new topics in this forum