elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Mensajes
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11
31  Informática / Hardware / Re: Nuevo Benchmark (Wprime) en: 30 Enero 2009, 10:55 am
el programa funciona aunque no hagas oc! xD
32  Informática / Hardware / Re: Nuevo Benchmark (Wprime) en: 30 Enero 2009, 10:42 am
un core2duo M
33  Informática / Hardware / Re: Nuevo Benchmark (Wprime) en: 29 Enero 2009, 23:07 pm
recorta la imagen.. es incomodo verla asi. tambien la puedes subir a http://i.elhacker.net
34  Informática / Hardware / Re: Nuevo Benchmark (Wprime) en: 29 Enero 2009, 22:11 pm

aqui esta mi i7
35  Media / Juegos y Consolas / Re: Nueva asignatura universitaria, StarCraft en: 29 Enero 2009, 19:45 pm
Un sueño hecho realidad. Por Aiur
36  Programación / .NET (C#, VB.NET, ASP) / Como sacar variable de Public void? en: 29 Enero 2009, 19:44 pm
Hola, estoy haciendo un programa que conecta a un servidor telnet y le envia unos comandos, para ello utilizo la DLL dotnettelnet. necesito sacar un dato de una funcion. en concreto e.Data en OnDataAvailable ¿como tengo que hacerlo? Gracias :P

aqui esta dotnettelnet.
http://sourceforge.net/project/showfiles.php?group_id=55312&package_id=50227&release_id=162640

este es el codigo:
Código
  1.  
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using De.Mud.Telnet;
  8. using System.IO;
  9.  
  10.  
  11. namespace Net.Graphite.Telnet
  12. {
  13.    /// <summary>
  14.    /// A simple console testbed for the Telnet application.
  15.    /// </summary>
  16.    public class TestClient
  17.    {
  18.        [STAThread]
  19.        static void Main(string[] args)
  20.  
  21.        {
  22.  
  23.            string Direccion;
  24.            string puerto;
  25.            Direccion = "aqui va la ip del servidor telnet";
  26.            puerto = "23";
  27.  
  28.  
  29.  
  30.            TestRun tr = new TestRun(Direccion, Int32.Parse(puerto));
  31.  
  32.            try
  33.            {
  34.  
  35.                    tr.InteractiveSession();// edit the method for specific cmds
  36.  
  37.            }
  38.            catch (Exception e)
  39.            {
  40.                Console.WriteLine("An exception has occurred: " +
  41.                    e.Message + "\n\n" + e.StackTrace + "\n");
  42.            }
  43.  
  44.        }
  45.    }
  46.  
  47.    public class TestRun
  48.    {
  49.        private TelnetWrapper t;
  50.        private bool done = false;
  51.        private StreamReader sr;
  52.        public string Datos;
  53.        public TestRun(string host, int port)
  54.        {
  55.            t = new TelnetWrapper();
  56.  
  57.            t.Disconnected += new DisconnectedEventHandler(this.OnDisconnect);
  58.            t.DataAvailable += new DataAvailableEventHandler(this.OnDataAvailable);
  59.  
  60.            t.TerminalType = "NETWORK-VIRTUAL-TERMINAL";
  61.            t.Hostname = host;
  62.            t.Port = port;
  63.            Console.WriteLine("Connecting ...");
  64.            t.Connect();
  65.  
  66.        }
  67.  
  68.        public void ScriptedSession()
  69.        {
  70.            Console.WriteLine("Not implemented.");
  71.        }
  72.  
  73.        public void InteractiveSession()
  74.        {
  75.            //int i;
  76.            //char ch;
  77.  
  78.            try
  79.            {
  80.                t.Receive();
  81.                string envio;                                            
  82.                envio = "admin\r\n";
  83.  
  84.                string envio2;
  85.  
  86.                string llegada;
  87.                envio2 = "sys iface\r\n";
  88.                //while (!done)
  89.                    t.Send(envio + envio2);
  90.  
  91.                    //Console.ReadLine();
  92.                    //t.Send(envio2);
  93.  
  94.  
  95.                    //t.Send(Console.ReadLine() + t.CRLF);
  96.  
  97.  
  98.  
  99.            }
  100.            catch
  101.            {
  102.                t.Disconnect();
  103.                throw;
  104.            }
  105.        }
  106.  
  107.        private void OnDisconnect(object sender, EventArgs e)
  108.        {
  109.            done = true;
  110.            Console.WriteLine("\nDisconnected.");
  111.  
  112.        }
  113.  
  114.  
  115.        public void OnDataAvailable(object sender, DataAvailableEventArgs e)
  116.        {
  117.  
  118.  
  119.  
  120.            //Console.Write(e.Data);
  121.  
  122.            this.Datos += e.Data
  123.        }
  124.  
  125.  
  126.  
  127.    }
  128. }
  129.  
  130.  
  131.  
37  Foros Generales / Foro Libre / Re: ¿Cómo diablos vuela este helicóptero? en: 28 Enero 2009, 08:41 am
A todos aquellos que no atienden a razones.
38  Informática / Hardware / Re: Benchmark - Test de velocidad a discos duros en: 26 Enero 2009, 16:24 pm
que quieres decir con eso de optimizado? XD
Aqui dejo otra captura ligeramente mejor.
39  Informática / Hardware / Re: Benchmark - Test de velocidad a discos duros en: 25 Enero 2009, 21:21 pm
Aqui va un raid0 de 2 discos de 200gb en una controladora sil3114. creo que son maxtor ahora lo miro.
40  Media / Juegos y Consolas / Re: Garantia 3 luces rojas XBOX360 en: 25 Enero 2009, 12:34 pm
ponle el firmware original al lector y la mandas.
Páginas: 1 2 3 [4] 5 6 7 8 9 10 11
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines