thanks for this tutorial,
i make 2 projects the first one contain the ChatServer class wich is contained b the "PC" name space.The second project contain the ChatClient class .
in the second project i need to use first project so i wrote

using PC;

but i've this ERROR

"The type or namespace name 'PC' could not be found (are you missing a using directive or an assembly reference?) "

what i have to do!
thx

The fastest fix is to change line "using PC;" to somethign like "using PC = ChatServer;" (replace "ChatServer" with your namespace)

After some tinkering with this tutorial, I realized I was having a problem: sometimes when one client disconnected, it would disconnect the other clients, or even crash the server. I also tried this with a standard telnet client connecting to the server.

The solution I came up with was to use the "lock" directive on the SendMsgToAll method in ChatServer, for the nickName and nicknNameByConnect, to make it a little more thread safe. Then I added some if(tcpClient[cnt].Connected == true) and if(tcpClient[cnt].Connected == false) logic to more predictably remove users from the hashtables and close the tcpClient connection on the server's end. Putting that logic in the catch block was too unpredictable IMO, since it removed users when anything at all went wrong: which was a tricky thing to catch given the fact that all user threads were interactive with the same nickName and nickNameByConnect instance variables.

I downloaded the source files, I made the server a separate application like you said. I run the server app first, then I run the client. And I get the following error: "Cross-thread operation not valid: Control '' accessed from a thread other than the thread it was created on."
Any ideas why this is happening? And how could I solve it?

This is a horrible project none of the classes fall in line the control you are using are ok, but when you are working with namespaces they aren't properly being recognized I am not sure what version of .Net you are using but I tried this on the 2008 Visual Studio and this code only partially worked and I was not sure if you started this for a Console project which I assumed it was and I really didnt like the clarity of this project it had some inclusions in it. this project did not even work to many errors and the name space PC what was that man come on make a better tutorial and lets get a chat program working.,

hey in visual studio did u make ur application a console based one or a windows form based one?
n should the chatserver n chatclient in 2 diff applications?
n wat abt docommunication? should it be associated with the chatserver or chatclient?
plz do reply back
i wanna noe how to run the pgm