rendered paste bodypublic static string SERVER = "irc.freenode.net";
private static int PORT = 6667;
private static string USER = "USER guest 0 * :A Guest";
private static string NICK = "botbotbot";
private static string CHANNEL = "#my_chan";
public static StreamWriter writer;
public static StreamReader reader;
public static TcpClient irc;
public static void Main(string[] args)
{
NetworkStream stream;
string inputLine;
string nickname;
try
{
irc = new TcpClient(SERVER, PORT);
stream = irc.GetStream();
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
// Start PingSender thread
writer.WriteLine(USER);
writer.Flush();
writer.WriteLine("/NICK " + NICK);
writer.Flush();
// writer.WriteLine("/JOIN " + CHANNEL);
// writer.Flush();
while ((inputLine = reader.ReadLine()) != null)
{
Console.WriteLine(inputLine);
}
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
finally
{
writer.Close();
reader.Close();
irc.Close();
Console.ReadLine();
}
}