Version: 1.0.6
Add Telnet, rsh, rexec and rlogin connectivity to your Windows or Web application.
That all the data sent and received between the client and the server is visible in a Trace event?
The Trace event is a handy tool for debugging applications. It will fire whenever the component sends or receives data, and is perfect for adding logging capabilities to your application.
Code Sample:
private void myComponent_Trace(object sender, SegmentEventArgs e) 
{ 
    // Append data to a file
    System.IO.FileStream file = new System.IO.FileStream("c:\\Test\\log.txt", System.IO.FileMode.Append); 
    file.Write(e.Segment.Buffer, 0, e.Segment.Count); 
    file.Close(); 
}
Back to Top
That data returning from a Telnet server can be searched for a token value, making automated scripting development a snap?
The WaitFor method will continue receiving data until the specified token has been found, or the specified Timout period has elapsed.
Code Sample:
telnet1.Connect("myserver");  // Connect to a server 
telnet1.WaitFor("ogin:"); // Read until "ogin" is found
telnet1.Send("myuser\r\n"); // Login received, send username 
telnet1.WaitFor("assword:"); // Now wait until "assword:" is found
telnet1.Send("mypass\r\n"); // Send password 
telnet1.WaitFor("$"); // Wait for command prompt
Back to Top
That Option Negotiation can be easily customized?
Specifying which options should be negotiated with the telnet server is easy when the ClientOptions and ServerOptions collections are used.
Code Sample:
// Cause the client to refuse the TerminalType option if offered by the server telnet1.ClientOptions.Remove(telnet1.ClientOptions[OptionCode.TerminalType]); 

// Request that server enable the Echo option 
telnet1.ServerOptions.Add(new Option(OptionCode.Echo)); 

// Connect and login to the Telnet server 
telnet1.Login("myserver", "myusername", "mypassword", "$");
Back to Top