right so probably best to start off with the end goal :) a very basic irc client so i can get my head around c# socket handling and response parsing etc.
simple bit of code so far but throws up the following error:
Error 1 The name 'writer' does not exist in the current context
Below is the code you can ignore some of it as thats due to the UI the bit thats causing the problem is at the bottom
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Net;
using System.Net.Sockets;
using System.IO;
using System.Threading;
namespace AngelIRC
{
public partial class AngelIRC : Form
{
public AngelIRC()
{
InitializeComponent();
}
private void aboutAngelIRCToolStripMenuItem_Click_1(object sender, EventArgs e)
{
// show about box
AboutBox AboutBox = new AboutBox();
AboutBox.Show();
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
{
// close application
Application.Exit();
}
private void homepageToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("http://www.furious-angels.com");
}
public static StreamWriter writer;
private void Form1_Load(object sender, EventArgs e)
{
this.ChatWindow.Text = "Welcome to AngelIRC \r\nConnect to an IRC Server using /server servername";
NetworkStream stream;
TcpClient irc;
string inputLine;
StreamReader reader;
string nickname;
irc = new TcpClient("www.angel-computers.co.uk", 6667);
stream = irc.GetStream();
reader = new StreamReader(stream);
writer = new StreamWriter(stream);
while ( (inputLine = reader.ReadLine () ) != null )
{
this.ChatWindow.Text = inputLine;
}
}
}
}