Trouble with StreamReader

Posted by John on Stack Overflow See other posts from Stack Overflow or by John
Published on 2010-03-29T18:22:52Z Indexed on 2010/03/29 18:33 UTC
Read the original article Hit count: 216

Filed under:
|
|

Alright so here is what I have so far,

List<string> lines = new List<string>();

using (StreamReader r = new StreamReader(f))
{
    string line;
    while ((line = r.ReadLine()) != null)
    {
        lines.Add(line);
    }
}

foreach (string s in lines)
{
    NetworkStream stream = irc.GetStream();

    writer.WriteLine(USER);
    writer.Flush();
    writer.WriteLine("NICK " + NICK);
    writer.Flush();
    writer.WriteLine("JOIN " + s);
    writer.Flush();


    string trimmedString = string.Empty;


    CHANNEL = s;
}

Unfortunately when my IRC dummy enters a room with a password set it writes out the password, if I make it change channel with a command such as #lol test

test being the password, since CHANNEL = s; it writes out the password with the command

writer.WriteLine("PRIVMSG " + CHANNEL + " :" + "Hello");

That is the only way to write out to IRC so is there a way for the "CHANNEL" to only be the start of the text and just #lol so it doesn't write out the password?

I hope you understand my problem.

© Stack Overflow or respective owner

Related posts about c#

Related posts about streamreader