public BeginExecute ( string commandText, AsyncCallback callback, object state ) : IAsyncResult | ||
commandText | string | The command text. |
callback | AsyncCallback | An optional asynchronous callback, to be called when the command execution is complete. |
state | object | A user-provided object that distinguishes this particular asynchronous read request from other requests. |
return | IAsyncResult |
public IAsyncResult BeginExecute(string commandText, AsyncCallback callback, object state)
{
CommandText = commandText;
return BeginExecute(callback, state);
}
SshCommand::BeginExecute ( ) : IAsyncResult | |
SshCommand::BeginExecute ( AsyncCallback callback ) : IAsyncResult | |
SshCommand::BeginExecute ( AsyncCallback callback, object state ) : IAsyncResult |
private void BeginService() { _client = new SshClient(Host, UserName, Password); _client.Connect(); _client.RunCommand("sudo pkill mono"); var call = string.Format("cd {0}", _homePiBuildindicatronServer); const string commandText = "sudo mono BuildIndicatron.Server.exe"; var text = call + " && " + commandText; _log.Info("Starting command:" + text); _runCommand = _client.CreateCommand(text); _beginExecute = _runCommand.BeginExecute(); streamReader = new StreamReader(_runCommand.OutputStream); WaitFor("Running", 6000).Wait(); }