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

Advertisement

venkates99
Joined:
Posts:
1
Location:
Bangalore

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

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.com";
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;
winscp.Start();

// 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");
winscp.StandardInput.Close();

string output = winscp.StandardOutput.ReadToEnd();

winscp.WaitForExit();

XPathDocument log = new XPathDocument(logname);
XmlNamespaceManager ns = new XmlNamespaceManager(new NameTable());
ns.AddNamespace("w", "https://winscp.net/schema/session/1.0");
XPathNavigator nav = log.CreateNavigator();



Thanks in advance,
Venkat

Reply with quote

Advertisement

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

Re: Not able log Error Message in LOG.XML file (downloading file

Can you be more specific about kind of the error and post some examples?

Reply with quote

Advertisement

You can post new topics in this forum