private void Receive()
{
// **STEP 1**
receive= new UdpClient(port);
RemoteIpEndPoint=null;
while(true)
{
try
{
// **STEP 2** receiving the data
byte[] receiveBytes=receive.Receive(ref RemoteIpEndPoint);
//Conver the data
string returnData=Encoding.Default.GetString(receiveBytes);
this.richTextBox1.Text+= (DateTime.Now.ToString ()+"\r\n"+returnData);
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
}
}
{
// **STEP 1**
receive= new UdpClient(port);
RemoteIpEndPoint=null;
while(true)
{
try
{
// **STEP 2** receiving the data
byte[] receiveBytes=receive.Receive(ref RemoteIpEndPoint);
//Conver the data
string returnData=Encoding.Default.GetString(receiveBytes);
this.richTextBox1.Text+= (DateTime.Now.ToString ()+"\r\n"+returnData);
}
catch(Exception e)
{
MessageBox.Show(e.ToString());
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货