+ 1
error when again press button in xamrain c#>>>THIS CODE
button = FindViewById<Button>(Resource.Id.button1); button.Click += delegate { string textToSend = "hi"; //---create a TCPClient object at the IP and port no.--- TcpClient client = new TcpClient("192.168.1.8", 5555); NetworkStream nwStream = client.GetStream(); byte[] bytesToSend = ASCIIEncoding.ASCII.GetBytes(textToSend); //---send the text--- nwStream.Write(bytesToSend, 0, bytesToSend.Length); //---read back the text--- client.Close(); nwStream.Close(); };
1 Odpowiedź
+ 1
what is description of the error, you have? I think, stream no closing