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

Execute() public method

Executes command specified by CommandText property.
Client is not connected. Operation has timed out.
public Execute ( ) : string
return string
        public string Execute()
        {
            return EndExecute(BeginExecute(null, null));
        }

Same methods

SshCommand::Execute ( string commandText ) : string

Usage Example

Exemplo n.º 1
0
 private int GetUserId()
 {
     using (var cmd = new SshCommand(Session, "id -u "))
         // Thease commands seems to be POSIX so the only problem would be Windows enviroment
     {
         cmd.Execute();
         return cmd.ExitStatus == 0 ? Int32.Parse(cmd.Result) : -1;
     }
 }
All Usage Examples Of Renci.SshNet.SshCommand::Execute