C#中networkstream和TcpClient.GetStream问题
发布网友
发布时间:2022-05-13 01:50
我来回答
共1个回答
热心网友
时间:2023-11-07 21:59
没影响。
可以这样操作
NetworkStream netStream=tcp.GetStream();
byte[] buffer =new byte[8912];
string msg="";
int bytesRead;
do { bytesRead = netStream.Read(buffer, 0, buffer.length); msg +=Encoding.Unicode.GetString(buffer,0, bytesRead );
} while (bytesRead > 0);