Version: 1.0.6
Add Telnet, rsh, rexec and rlogin connectivity to your Windows or Web application.

Telnet .NET Component

The Telnet component fills the Telnet gap in the .NET Framework. Use the Telnet component to easily communicate with remote Telnet servers. Features include:

  • The Login method logs into the server and issues username and password with one step.
  • Rexec, Rsh and Rlogin support.
  • For synchronous operation, use the Send and Receive methods.
  • For asynchronous operation, use the BeginSend and BeginReceive methods.
  • Use the default option negotiation which negotiates most common options.
  • Use the highly-customizable option negotiation for custom negotiation.
  • The WaitFor method reads from the stream until a token is received. Ideal for scripting applications.
  • Integrates with all versions of Visual Studio and supports C#, VB.NET, ASP.NET, Delphi 8, C# Builder, and other .NET compliant development environments.

Looking for the ActiveX version of this component?

Interface

Public Constructors
Telnet Overloaded. Initialize a new instance of the Telnet class.
Public Properties
Binary Gets or sets a value which indicates if the TRANSMIT-BINARY option should be negotiated for both client and server.
ClientOptions Contains the current client options for a Telnet session.
Echo Gets or sets a value which inidicates that the ECHO option should be negotiated.
Editor In Visual Studio.NET, displays an interactive form to use to test real time protocol operations.
ServerOptions Contains the current server options for a Telnet session.
TerminalType Gets or sets a value representing the client's terminal type.
WindowSize Gets or sets a value representing the client's window size.
Public Methods
Login Connects to a Telnet server and attempts to automatically login.
Refresh Performs option negotiation for any option that has not yet been sent.
SendCommand Send a Telnet control functions.
SendOption Send option data to the remote host.
SendSubOption Send suboption data to the remote host.
WaitFor Reads data from the stream until the specified string is found.
Public Events
ClientOptionChanged Raised when a client Telnet option has changed state (WILL or WONT confirmed).
CommandReceived This event is raised when a Telnet command has been received from the server.
ServerOptionChanged Raised when a server Telnet option has changed state (DO or DONT confirmed).

Code Example

How easy is the Telnet component to use? This example demonstrates basic Telnet usage.

' Set ReceiveTimeout to nonzero, required for Login method
Telnet1.ReceiveTimeout = 3000

' Login
Telnet1.Login("myserver", "myuser", "mypass", "$ ")

' Send a command
Telnet1.Send("pwd" + vbCrLf)

' Receive the response
Dim Seg As Segment = Telnet1.Receive()
Debug.WriteLine(Seg.ToString())

' Close the connection
Telnet1.Close()