SocketTools .NET Edition

TelnetClient.Search Method (String, String)

Search for a specific character sequence in the data stream.

[Visual Basic]
Overloads Public Function Search( _
   ByVal value As String, _
   ByRef buffer As String _
) As Boolean
[C#]
public bool Search(
   string value,
   ref string buffer
);

Parameters

value
A string argument which specifies the sequence of characters to search for in the data stream. When this sequence of characters is found, the method will return.
buffer
An string that will contain the output sent by the server, up to and including the search string character sequence.

Return Value

This method returns a Boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The Search method searches for a character sequence in the data stream and stops reading when it is found. This is useful when the client wants to automate responses to the server, such as executing a command and processing the output. The method collects the output from the server and stores it in a buffer provided by the caller. When the method returns, the buffer will contain everything sent by the server up to and including the search string.

See Also

TelnetClient Class | SocketTools Namespace | TelnetClient.Search Overload List