Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Get the string result from Execute() during the execution

$
0
0
Hi all
I am using SshCommand object and running an SSH file on a Linux machine using the Execute() function as follow

SshCommand command = client.CreateCommand(string.Format("{0} {1}", shPath, cmdPath));
command.CommandTimeout = new TimeSpan(24, 0, 0);
string commandResult = command.Execute();
StreamWriter sw = new StreamWriter(logFilePath);
sw.WriteLine(commandResult);
sw.Close();

I want to display the result string (as an execution's log) and sometimes the execution takes several minutes while in this time I can't display anything.

I want to display the result during the execution so the end user will see the progress.
so what I need is an option to get the string result during the execution.
Can anyone help me how can i do it?

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>