C# Класс Renci.SshNet.SshCommand

Represents SSH command that can be executed.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
BeginExecute ( ) : IAsyncResult

Begins an asynchronous command execution.

BeginExecute ( AsyncCallback callback ) : IAsyncResult

Begins an asynchronous command execution.

BeginExecute ( AsyncCallback callback, object state ) : IAsyncResult

Begins an asynchronous command execution.

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

Begins an asynchronous command execution.

CancelAsync ( ) : void

Cancels command execution in asynchronous scenarios.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

EndExecute ( IAsyncResult asyncResult ) : string

Waits for the pending asynchronous command execution to complete.

Execute ( ) : string

Executes command specified by CommandText property.

Execute ( string commandText ) : string

Executes the specified command text.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

Приватные методы

Метод Описание
Channel_Closed ( object sender, ChannelEventArgs e ) : void
Channel_DataReceived ( object sender, ChannelDataEventArgs e ) : void
Channel_ExtendedDataReceived ( object sender, ChannelExtendedDataEventArgs e ) : void
Channel_RequestReceived ( object sender, ChannelRequestEventArgs e ) : void
CreateChannel ( ) : IChannelSession
Session_Disconnected ( object sender, EventArgs e ) : void
Session_ErrorOccured ( object sender, ExceptionEventArgs e ) : void
SshCommand ( ISession session, string commandText, Encoding encoding ) : System

Initializes a new instance of the SshCommand class.

UnsubscribeFromEventsAndDisposeChannel ( IChannel channel ) : void

Unsubscribes the current SshCommand from channel events, and disposes the IChannel.

Does nothing when channel is null.

WaitOnHandle ( WaitHandle waitHandle ) : void The actual command will be included in the exception message.

Описание методов

BeginExecute() публичный метод

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
Результат IAsyncResult

BeginExecute() публичный метод

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 ( AsyncCallback callback ) : IAsyncResult
callback AsyncCallback An optional asynchronous callback, to be called when the command execution is complete.
Результат IAsyncResult

BeginExecute() публичный метод

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 ( AsyncCallback callback, object state ) : IAsyncResult
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.
Результат IAsyncResult

BeginExecute() публичный метод

Begins an asynchronous command execution.
Client is not connected. Operation has timed out.
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.
Результат IAsyncResult

CancelAsync() публичный метод

Cancels command execution in asynchronous scenarios.
public CancelAsync ( ) : void
Результат void

Dispose() публичный метод

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public Dispose ( ) : void
Результат void

Dispose() защищенный метод

Releases unmanaged and - optionally - managed resources
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
Результат void

EndExecute() публичный метод

Waits for the pending asynchronous command execution to complete.
Either the IAsyncResult object did not come from the corresponding async method on this type, or EndExecute was called multiple times with the same IAsyncResult. is null.
public EndExecute ( IAsyncResult asyncResult ) : string
asyncResult IAsyncResult The reference to the pending asynchronous request to finish.
Результат string

Execute() публичный метод

Executes command specified by CommandText property.
Client is not connected. Operation has timed out.
public Execute ( ) : string
Результат string

Execute() публичный метод

Executes the specified command text.
Client is not connected. Operation has timed out.
public Execute ( string commandText ) : string
commandText string The command text.
Результат string