请问用socket 如何发送字符串数组啊?? 只知道如何发送字符串,数组..
name += str+" ";
byte[] bytename = Encoding.ASCII.GetBytes(connections.ToString()+name);
service.Send(bytename,bytename.Length,0);
service.Close();
connections是一个数字,name是一个字符串数组,想把这些数据发送一下,client 那边应该如何接受这些数据呢,第一个是connections这个数据,第二个是字符串数组。string[] member = new string[number];此时,number=接受的connections
members是接受的数组、
帮忙看看 谢谢了!
name += str+" ";
byte[] bytename = Encoding.ASCII.GetBytes(connections.ToString()+name);
service.Send(bytename,bytename.Length,0);
service.Close();
connections是一个数字,name是一个字符串数组,想把这些数据发送一下,client 那边应该如何接受这些数据呢,第一个是connections这个数据,第二个是字符串数组。string[] member = new string[number];此时,number=接受的connections
members是接受的数组、
帮忙看看 谢谢了!
接收端要还原成字符串很容易的://假设recievedDataBuffer 是接收到的数据
byte[] recievedDataBuffer =...
string recievedInfo=Encoding.ASCII.GetString(recievedDataBuffer);