Topic "Not able log Error Message in LOG.XML file (downloading file"

Author Message
[View user's profile]

Joined: 2012-03-21
Posts: 1
Location: Bangalore
This is my code to download a file from host, when it is success its logging success details in log file,
when it is fails to download, its logging any error details in log file.

Please verify my code below and correct it to get error message in log file.
winscp.StartInfo.FileName = @"C://";
winscp.StartInfo.Arguments = "/log=\"" + logname + "\"";
winscp.StartInfo.UseShellExecute = false;
winscp.StartInfo.RedirectStandardInput = true;
winscp.StartInfo.RedirectStandardOutput = true;
winscp.StartInfo.CreateNoWindow = true;
winscp.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;

// Feed in the scripting commands
winscp.StandardInput.WriteLine("option batch continue");
winscp.StandardInput.WriteLine("option confirm off");
winscp.StandardInput.WriteLine("open " + "host and user & pwd");
winscp.StandardInput.WriteLine(" get " + "remotepath" + "localpath");

string output = winscp.StandardOutput.ReadToEnd();


XPathDocument log = new XPathDocument(logname);
XmlNamespaceManager ns = new XmlNamespaceManager(new NameTable());
ns.AddNamespace("w", "");
XPathNavigator nav = log.CreateNavigator();

Thanks in advance,
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24759
Location: Prague, Czechia
Can you be more specific about kind of the error and post some examples?
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License