Click here to Skip to main content
15,895,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I prefered to know how to develop a simple chat system. So I refered a web note.
http://csharp.net-informations.com/communications/csharp-chat-client.htm[^]

But as It preview, my output didn't work. Textbox1 didn't show the user input as preview. If you have an idea please explain it. Thanks

[edit]"Treat my content as plain text..." option disabled - OriginalGriff[/edit]
Posted
Updated 28-Aug-11 22:00pm
v2

Even I can work out that if I get a piece of software from somewhere on the net and I have a problem with it, the best place to ask is the web site I got the code from. Not a totally unrelated site, the one I got the code from.
If you look at the bottom of that site, there is a "mail to" link - have you considered trying it?
 
Share this answer
 
Comments
Jeremy Shin Woo 29-Aug-11 7:10am    
ok.. Thanks
change as,

<pre lang="c#">private void btnSend_Click(object sender, EventArgs e)
{
NetworkStream serverStream = clientSocket.GetStream();
byte[] outStream = System.Text.Encoding.ASCII.GetBytes(textBox1.Text+"$");
serverStream.Write(outStream, 0, outStream.Length);
serverStream.Flush();

byte[] inStream = new byte[10025];
serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
string returndata = System.Text.Encoding.ASCII.GetString(inStream);
//string returndata = Convert.ToString(data);
msg("Data from Server: " + returndata);
}

public void msg(string mesg)
{
txtLog.Text = txtLog.Text + Environment.NewLine + ">>" + mesg;
}</pre>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900