Sends command to TELNET server terminated by command terminator.
Namespace: Jscape.TelnetAssembly: Jscape.Telnet (in Jscape.Telnet.dll) Version: 2.6.1.0
Syntax
C# |
---|
public string Send( string command, int timeout ) |
Visual Basic |
---|
Public Function Send ( _ command As String, _ timeout As Integer _ ) As String |
Visual C++ |
---|
public: String^ Send( String^ command, int timeout ) |
Parameters
- command
- Type: System..::..String
The command to send.
- timeout
- Type: System..::..Int32
The maximum timeout for the task in milliseconds. The default timeout is 120 seconds.
Return Value
The response from the TELNET server.
Remarks
Waits until the shell prompt is returned by TELNET server buffering
response data as defined by the timeout parameter.
Examples
To send a command to the TELNET server, pass in the command to send and the timeout
value to wait for task completion.
The Send method automatically appends '\n' to the command.
CopySend
CopySend

// Send command to TELNET server with 5 second timeout. session.Send("ls -al", 5000);

' Send command to TELNET server with 5 second timeout. session.Send("ls -al", 5000)