aqui esta dotnettelnet.
http://sourceforge.net/project/showfiles.php?group_id=55312&package_id=50227&release_id=162640
este es el codigo:
Código
using System; using System.Collections.Generic; using System.Linq; using System.Text; using De.Mud.Telnet; using System.IO; namespace Net.Graphite.Telnet { /// <summary> /// A simple console testbed for the Telnet application. /// </summary> public class TestClient { [STAThread] static void Main(string[] args) { string Direccion; string puerto; Direccion = "aqui va la ip del servidor telnet"; puerto = "23"; try { tr.InteractiveSession();// edit the method for specific cmds } catch (Exception e) { Console.WriteLine("An exception has occurred: " + e.Message + "\n\n" + e.StackTrace + "\n"); } } } public class TestRun { private TelnetWrapper t; private bool done = false; private StreamReader sr; public string Datos; public TestRun(string host, int port) { t.TerminalType = "NETWORK-VIRTUAL-TERMINAL"; t.Hostname = host; t.Port = port; Console.WriteLine("Connecting ..."); t.Connect(); } public void ScriptedSession() { Console.WriteLine("Not implemented."); } public void InteractiveSession() { //int i; //char ch; try { t.Receive(); string envio; envio = "admin\r\n"; string envio2; string llegada; envio2 = "sys iface\r\n"; //while (!done) t.Send(envio + envio2); //Console.ReadLine(); //t.Send(envio2); //t.Send(Console.ReadLine() + t.CRLF); } catch { t.Disconnect(); throw; } } private void OnDisconnect(object sender, EventArgs e) { done = true; Console.WriteLine("\nDisconnected."); } public void OnDataAvailable(object sender, DataAvailableEventArgs e) { //Console.Write(e.Data); this.Datos += e.Data } } }