Ejemplo n.º 1
0
 public IrcBot()
 {
     using (StreamReader sR = new StreamReader("PASS.txt"))
     {
         PASS = sR.ReadLine();
     }
     try
     {
         handler = new InputHandler();
         irc     = new TcpClient(SERVER, PORT);
         stream  = irc.GetStream();
         reader  = new StreamReader(stream);
         writer  = new StreamWriter(stream)
         {
             AutoFlush = true
         };
         ping = new PingSender();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     stop      = false;
     botThread = new Thread(Run);
     botThread.IsBackground = true;
     botThread.Start();
 }
Ejemplo n.º 2
0
 public IrcBot()
 {
     using (StreamReader sR = new StreamReader("PASS.txt"))
     {
         PASS = sR.ReadLine();
     }
     try
     {
         handler = new InputHandler();
         irc = new TcpClient(SERVER, PORT);
         stream = irc.GetStream();
         reader = new StreamReader(stream);
         writer = new StreamWriter(stream) { AutoFlush = true };
         ping = new PingSender();
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
     }
     stop = false;
     botThread = new Thread(Run);
     botThread.IsBackground = true;
     botThread.Start();
 }