Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Well, "put" fails if session is not open. So the check you have there is enough.
Guest

yes of course! ;)
this my .net (c#) code :

Process m_WinSCP = new Process();

m_WinSCP.StartInfo.FileName = "WinSCP.com";
m_WinSCP.StartInfo.UseShellExecute = false;
m_WinSCP.StartInfo.RedirectStandardInput = true;
m_WinSCP.StartInfo.RedirectStandardOutput = true;
m_WinSCP.StartInfo.CreateNoWindow = true;
m_WinSCP.Start();

m_WinSCP.StandardInput.WriteLine("option batch abort");
m_WinSCP.StandardInput.WriteLine("option confirm off");
m_WinSCP.StandardInput.WriteLine("open ftp://127.0.0.1");
m_WinSCP.StandardInput.WriteLine("put myfile.txt");
m_WinSCP.StandardInput.Close();
m_WinSCP.WaitForExit();

if (0 == m_WinSCP.ExitCode)
{
  //success
}


it's work great, i can upload and download.
but when i open a sesssion how can i know before upload or download if my session is active ?

thanks for your help.
martin

Re: How to test if the connection was successfull ?

Can you give us more details about your use case?
sorcer1

How to test if the connection was successfull ?

hello,

i want to know if my connection was successfull.

how can i do this ?

thank you