Renci.SshNet.SshCommand.BeginExecute C# (CSharp) Method

BeginExecute() public method

Begins an asynchronous command execution.
Asynchronous operation is already in progress. Invalid operation. CommandText property is empty. Client is not connected. Operation has timed out. Asynchronous operation is already in progress. CommandText property is empty.
public BeginExecute ( ) : IAsyncResult
return IAsyncResult
        public IAsyncResult BeginExecute()
        {
            return BeginExecute(null, null);
        }

Same methods

SshCommand::BeginExecute ( AsyncCallback callback ) : IAsyncResult
SshCommand::BeginExecute ( AsyncCallback callback, object state ) : IAsyncResult
SshCommand::BeginExecute ( string commandText, AsyncCallback callback, object state ) : IAsyncResult

Usage Example

コード例 #1
0
		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();
		}
All Usage Examples Of Renci.SshNet.SshCommand::BeginExecute