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,
	bool regex
)
Visual Basic
Public Function SendWait ( _
	command As String, _
	prompt As String, _
	regex As Boolean _
) As String
Visual C++
public:
String^ SendWait(
	String^ command, 
	String^ prompt, 
	bool regex
)

Parameters

command
Type: System..::..String
The command to send.
prompt
Type: System..::..String
The prompt returned by the TELNET server..
regex
Type: System..::..Boolean
True if prompt is a regular expression, False otherwise.

Return Value

The response from the TELNET server.

Remarks

Waits until the prompt is returned by TELNET server buffering response data. Refer to the Visual Studio .NET documentation for more information about creating reagular expressions.
Note: The default timeout is 120 seconds.

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", "[Ee]nter new password:", true);

CopySendWait
' Send command to TELNET server.
session.SendWait("passwd", "[Ee]nter new password:", true)

See Also