C# IRC Client API

7 באוקטובר 2007

תגיות: , ,
7 תגובות

Here is a little IRC API that I wrote allows you to connect to IRC server easily.

The syntax to create the IrcClient is:

   1: //Set the server details
   2: ServerInfo serverInfo = new ServerInfo("irc.mircx.co.il", 6667, "GiladBot", "Gilad C# Bot", "gilad.lavian@gmail.com", "#test");
   4: //Create a IrcClient
   5: IrcClient ircClient = IrcClientFactory.CreateIrcClient(serverInfo);
   7: //Subscribe to the irc server events
   8: ircClient.OnServerText += new ServerTextHandler(ircClient_OnServerText);
   9: ircClient.OnConnect += new ConnectHandler(ircClient_OnConnect);
  10: ircClient.OnDataSend += new DataSendHandler(ircClient_OnDataSend);
  11: ircClient.OnDisconnect += new DisconnectHandler(ircClient_OnDisconnect);
  13: //Connect to the server
  14: ircClient.Connect();


The API knows to catch some event happening in the channel and it can send command to the server like:

1. Change nickname

2. Part a channel

3. Join a channel


Fell free to add or change the code as you wish…



Complete Solution (Client and API)

הוסף תגובה
facebook linkedin twitter email

כתיבת תגובה

האימייל לא יוצג באתר. שדות החובה מסומנים *

7 תגובות

  1. Moshe L8 באוקטובר 2007 ב 8:46

    In 5763 (2003) I used some VB6 code that I found on net, and modifed it to IRC Bot.
    the backend was a MDB file used to store all relevance data (op,voice, messages).


  2. Yogev I4 בדצמבר 2007 ב 13:21

    mm.. how i can use this api?

    when i downloaded the file i got some files
    and folders. let's say i start a new windows
    project (win form), i set "memo text", "textbox",
    buttons.. etc.. and i want to set a connection to
    a irc server, what i need to do before i call those
    function that u created?

    thanks again!

  3. Gilad Lavian5 בדצמבר 2007 ב 0:50

    Thanks Yogev, I appreciate your comment.

    For your convenience I've attached the complete solution with the Client and the API.

  4. Guy11 בדצמבר 2007 ב 12:54

    Thank you for the help, but I have a question.

    Does the user have to run an IRC client for my C# program to connect?

  5. Gilad Lavian11 בדצמבר 2007 ב 13:01

    Guy, You dont need an external client (GUI) to connect, this can be the client itself.
    You can use the API to connect to IRC servers with simple console.

  6. ivan tamsir8 במאי 2009 ב 9:29

    Thanks very much for sharing..