We need you!

We're working hard on the next version of Developer Fusion. Let us know what you think we should be up to!

Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 71,636 times

Contents

Downloads

Related Categories

A Console IRC Bot - Introduction

CumpsD

Introduction

I'm planning to write some articles based on questions I get from fellow students. The first one is how to get on IRC with C#? . So, here it is, the first article of (hopefully) many.

Let's start by telling what IRC is. This is best done by reading the Internet Relay Chat Protocol RFC. You can find anything you want about the IRC protocol in there.

Getting on IRC is as simple as:

  • Establishing a connection.
  • Logging in.
  • Maintaining a connection and reacting to commands.

As this is an article on how to establish an IRC connection and work with the commands, I'm not going to spent any time on UI. Therefore this will be a simple Console Application ( cIRC ).

We'll make a seperate class for the IRC functions so we could re-use it later when we want to add a UI.

using System;
using System.Net;
using System.Net.Sockets;
using System.IO;

namespace System.Net {
      public class IRC {

      } /* IRC */
} /* System.Net */

Comments

  • Re: couldnt connect to irc server

    Posted by stevo3463 on 19 Apr 2007

    i have the same error as this guy, i know this was LONG ago but i cannot figure out how to get past this !


     


    can someone please contact me


    Email:  Re: couldnt connect to irc server

    Posted by tomthemoron1 on 19 Aug 2006

    That is not a C# error.. It's actually an IRC error, which means you connected to the server. You need to do a few commands so that you can login/etc.


    Example:


    USER Veeresh&nbs...

  • couldnt connect to irc server

    Posted by veeresh on 17 Jun 2005

    i tried to run this application, i got following error, plz help me out.

    NOTICE AUTH :*** Looking up your hostname NOTICE AUTH :*** Checking Ident NOTICE AUTH :*** Couldn't look up your hostname :b...

  • i dont understand X_X

    Posted by chubbz_SF on 22 Dec 2004

    please put it in vb.net form :]

    or any vb

  • Posted by James Crowley on 25 Mar 2004

    Welcome to Developer Fusion, David! :D