string recStr = "";
byte[] recByte = new byte[1024];
int bytes = 0; try
{
bytes = socket.Receive(recByte, recByte.Length, 0);
recStr += Encoding.Default.GetString(recByte, 0, bytes);
this.textBox2.Text = recStr;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
} socket.Shutdown(SocketShutdown.Both);//这里报错 socket.Close();
}
byte[] recByte = new byte[1024];
int bytes = 0; try
{
bytes = socket.Receive(recByte, recByte.Length, 0);
recStr += Encoding.Default.GetString(recByte, 0, bytes);
this.textBox2.Text = recStr;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
} socket.Shutdown(SocketShutdown.Both);//这里报错 socket.Close();
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货