Sends command to TELNET server terminated by command terminator.

Namespace: Jscape.Telnet
Assembly: Jscape.Telnet (in Jscape.Telnet.dll) Version: 2.6.1.0

Syntax

C#
public string SendWait(
	string command,
	string prompt,
	int timeout
)
Visual Basic
Public Function SendWait ( _
	command As String, _
	prompt As String, _
	timeout As Integer _
) As String
Visual C++
public:
String^ SendWait(
	String^ command, 
	String^ prompt, 
	int timeout
)

Parameters

command
Type: System..::..String
The command to send.
prompt
Type: System..::..String
The prompt returned by the TELNET server.
timeout
Type: System..::..Int32
The maximum time in milliseconds task will wait until prompt is returned by TELNET server. The default timeout is 120 seconds.

Return Value

The response from the TELNET server.

Remarks

Waits until the prompt is returned by TELNET server buffering response data.

Examples

To send a command to the TELNET server, pass in the command to send, and the prompt to wait for. The SendWait method automatically appends '\n' to the command.
CopySendWait
// Send command to TELNET server.
session.SendWait("passwd", "Enter new password:", 5000);

CopySendWait
' Send command to TELNET server.
session.SendWait("passwd", "Enter new password:", 5000)

See Also