C# 클래스 Renci.SshNet.SshClient

Provides client connection to SSH server.
상속: BaseClient
파일 보기 프로젝트 열기: sshnet/SSH.NET 1 사용 예제들

공개 메소드들

메소드 설명
AddForwardedPort ( ForwardedPort port ) : void

Adds the forwarded port.

CreateCommand ( string commandText ) : SshCommand

Creates the command to be executed.

CreateCommand ( string commandText, Encoding encoding ) : SshCommand

Creates the command to be executed with specified encoding.

This method will change current default encoding.

CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput ) : Shell

Creates the shell.

CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes ) : Shell

Creates the shell.

CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes, int bufferSize ) : Shell

Creates the shell.

CreateShell ( Stream input, Stream output, Stream extendedOutput ) : Shell

Creates the shell.

CreateShell ( Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes ) : Shell

Creates the shell.

CreateShell ( Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes, int bufferSize ) : Shell

Creates the shell.

CreateShellStream ( string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize ) : ShellStream

Creates the shell stream.

The TERM environment variable contains an identifier for the text window's capabilities. You can get a detailed list of these cababilities by using the ‘infocmp’ command.

The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer to the drawable area of the window.

CreateShellStream ( string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, uint>.IDictionary terminalModeValues ) : ShellStream

Creates the shell stream.

The TERM environment variable contains an identifier for the text window's capabilities. You can get a detailed list of these cababilities by using the ‘infocmp’ command.

The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer to the drawable area of the window.

RemoveForwardedPort ( ForwardedPort port ) : void

Stops and removes the forwarded port from the list.

RunCommand ( string commandText ) : SshCommand

Creates and executes the command.

This method internally uses asynchronous calls.

SshClient ( ConnectionInfo connectionInfo ) : System

Initializes a new instance of the SshClient class.

SshClient ( string host, string username ) : System

Initializes a new instance of the SshClient class.

SshClient ( string host, string username, string password ) : System

Initializes a new instance of the SshClient class.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Releases unmanaged and - optionally - managed resources

OnDisconnected ( ) : void

Stops forwarded ports.

OnDisconnecting ( ) : void

Called when client is disconnecting from the server.

비공개 메소드들

메소드 설명
AttachForwardedPort ( ForwardedPort port ) : void
DetachForwardedPort ( ForwardedPort port ) : void
EnsureSessionIsOpen ( ) : void
SshClient ( ConnectionInfo connectionInfo, bool ownsConnectionInfo ) : System

Initializes a new instance of the SshClient class.

If ownsConnectionInfo is true, then the connection info will be disposed when this instance is disposed.

SshClient ( ConnectionInfo connectionInfo, bool ownsConnectionInfo, IServiceFactory serviceFactory ) : System

Initializes a new instance of the SshClient class.

If ownsConnectionInfo is true, then the connection info will be disposed when this instance is disposed.

SshClient ( string host, int port, string username ) : System
SshClient ( string host, int port, string username, string password ) : System

메소드 상세

AddForwardedPort() 공개 메소드

Adds the forwarded port.
Forwarded port is already added to a different client. is null. Client is not connected.
public AddForwardedPort ( ForwardedPort port ) : void
port ForwardedPort The port.
리턴 void

CreateCommand() 공개 메소드

Creates the command to be executed.
Client is not connected.
public CreateCommand ( string commandText ) : SshCommand
commandText string The command text.
리턴 SshCommand

CreateCommand() 공개 메소드

Creates the command to be executed with specified encoding.
This method will change current default encoding.
Client is not connected. or is null.
public CreateCommand ( string commandText, Encoding encoding ) : SshCommand
commandText string The command text.
encoding System.Text.Encoding The encoding to use for results.
리턴 SshCommand

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput ) : Shell
encoding System.Text.Encoding The encoding.
input string The input.
output Stream The output.
extendedOutput Stream The extended output.
리턴 Shell

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes ) : Shell
encoding System.Text.Encoding The encoding.
input string The input.
output Stream The output.
extendedOutput Stream The extended output.
terminalName string Name of the terminal.
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
terminalModes uint>.IDictionary The terminal modes.
리턴 Shell

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Encoding encoding, string input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes, int bufferSize ) : Shell
encoding System.Text.Encoding The encoding to use to send the input.
input string The input.
output Stream The output.
extendedOutput Stream The extended output.
terminalName string Name of the terminal.
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
terminalModes uint>.IDictionary The terminal mode.
bufferSize int Size of the internal read buffer.
리턴 Shell

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Stream input, Stream output, Stream extendedOutput ) : Shell
input Stream The input.
output Stream The output.
extendedOutput Stream The extended output.
리턴 Shell

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes ) : Shell
input Stream The input.
output Stream The output.
extendedOutput Stream The extended output.
terminalName string Name of the terminal.
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
terminalModes uint>.IDictionary The terminal mode.
리턴 Shell

CreateShell() 공개 메소드

Creates the shell.
Client is not connected.
public CreateShell ( Stream input, Stream output, Stream extendedOutput, string terminalName, uint columns, uint rows, uint width, uint height, uint>.IDictionary terminalModes, int bufferSize ) : Shell
input Stream The input.
output Stream The output.
extendedOutput Stream The extended output.
terminalName string Name of the terminal.
columns uint The columns.
rows uint The rows.
width uint The width.
height uint The height.
terminalModes uint>.IDictionary The terminal mode.
bufferSize int Size of the internal read buffer.
리턴 Shell

CreateShellStream() 공개 메소드

Creates the shell stream.

The TERM environment variable contains an identifier for the text window's capabilities. You can get a detailed list of these cababilities by using the ‘infocmp’ command.

The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer to the drawable area of the window.

Client is not connected.
public CreateShellStream ( string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize ) : ShellStream
terminalName string The TERM environment variable.
columns uint The terminal width in columns.
rows uint The terminal width in rows.
width uint The terminal height in pixels.
height uint The terminal height in pixels.
bufferSize int Size of the buffer.
리턴 ShellStream

CreateShellStream() 공개 메소드

Creates the shell stream.

The TERM environment variable contains an identifier for the text window's capabilities. You can get a detailed list of these cababilities by using the ‘infocmp’ command.

The column/row dimensions override the pixel dimensions(when nonzero). Pixel dimensions refer to the drawable area of the window.

Client is not connected.
public CreateShellStream ( string terminalName, uint columns, uint rows, uint width, uint height, int bufferSize, uint>.IDictionary terminalModeValues ) : ShellStream
terminalName string The TERM environment variable.
columns uint The terminal width in columns.
rows uint The terminal width in rows.
width uint The terminal height in pixels.
height uint The terminal height in pixels.
bufferSize int Size of the buffer.
terminalModeValues uint>.IDictionary The terminal mode values.
리턴 ShellStream

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

OnDisconnected() 보호된 메소드

Stops forwarded ports.
protected OnDisconnected ( ) : void
리턴 void

OnDisconnecting() 보호된 메소드

Called when client is disconnecting from the server.
protected OnDisconnecting ( ) : void
리턴 void

RemoveForwardedPort() 공개 메소드

Stops and removes the forwarded port from the list.
is null.
public RemoveForwardedPort ( ForwardedPort port ) : void
port ForwardedPort Forwarded port.
리턴 void

RunCommand() 공개 메소드

Creates and executes the command.
This method internally uses asynchronous calls.
CommandText property is empty. Invalid Operation - An existing channel was used to execute this command. Asynchronous operation is already in progress. Client is not connected. is null.
public RunCommand ( string commandText ) : SshCommand
commandText string The command text.
리턴 SshCommand

SshClient() 공개 메소드

Initializes a new instance of the SshClient class.
is null.
public SshClient ( ConnectionInfo connectionInfo ) : System
connectionInfo ConnectionInfo The connection info.
리턴 System

SshClient() 공개 메소드

Initializes a new instance of the SshClient class.
is null. is invalid, -or- is null or contains only whitespace characters.
public SshClient ( string host, string username ) : System
host string Connection host.
username string Authentication username.
리턴 System

SshClient() 공개 메소드

Initializes a new instance of the SshClient class.
is null. is invalid, or is null or contains only whitespace characters.
public SshClient ( string host, string username, string password ) : System
host string Connection host.
username string Authentication username.
password string Authentication password.
리턴 System