Shell Class
Namespace: Rebex.TerminalEmulation
Assembly: Rebex.Terminal.dll (version 7.0.9119)
Represents a Unix-like or DOS-like shell.
Syntax
public abstract class Shell
Inherited Members
Constructors
Name | Description |
---|---|
Shell(ShellChannel) | Initializes a new instance of Shell class based on the specified channel. |
Fields
Name | Description |
---|---|
EndOfResponse | A character that is used by the ReadChar() method to represent an end of response. |
Properties
Name | Description |
---|---|
Connected | Returns a value indicating whether the Shell object is connected. |
Encoding | Gets or sets the character encoding for incoming and outgoing data. |
IsRunning | Returns a value indicating whether a command is currently running. |
LastMatchedPrompt | Gets the last matched prompt (set when the end of command response has been reached). Only works in prompt-based mode. |
Mode | Gets the shell mode. |
Prompt | Gets or sets the prompt sequence that is used to detect response end. To use regular expressions, prepend the string with "regex:". To use wildcards, prepend the string with "mask:". Prompt sequence is only used when shell Mode is Prompt |
StripEscapeSequences | Gets or sets a value indicating whether to strip escape sequences from the incoming data. |
Timeout | Gets or sets the length of time in milliseconds before an operation times out (specify -1 or 0 to indicate that the request does not time out). |
Methods
Name | Description |
---|---|
Close() | Closed the communication channel. |
DetectKnownShell() | This method is a part of the component infrastructure and is not intended to be used directly by user code. |
GetExitCode() | Gets the exit code of the last command, if available./// Only supported in Shell instances initialized by method
or method.
Not supported in Shell instances initialized via class.
|
ReadAll() | Reads a multi-line response from the server. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
ReadAll(String[]) | Reads a multi-line response from the server. Returns if either the question prompt has been received (and no other data are pending) or the end of response has been reached. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
ReadChar() | Reads a character from the server. Returns an EndOfResponse character if the end of response has been reached. |
ReadLine() | Reads a single line of response from the server. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
ReadLine(String[]) | Reads a single line of response from the server. Returns if either end of line was detected or the question prompt has been received (and no other data are pending) or the end of response has been reached. Returns null reference (Nothing in Visual Basic) if the end of response has been reached without any preceding data. |
SendBreak(Int32) | Sends a break request to the server. This may or may not have any effect. Caution: some Telnet servers don't handle this correctly, causing subsequent commands to fail! |
SendCommand(String) | Sends a command to the server. This assumes that either there is no command running at the moment or that a question prompt was encountered. |
SendCommand(String, Boolean) | Sends a command to the server. This assumes that either there is no command running at the moment or that a question prompt was encountered. |