日期:2014-05-17 浏览次数:21054 次
UdpClient client = new UdpClient(7901);
IPEndPoint ep = null;
byte[] data = client.Receive(ref ep);
string data_receive = Encoding.UTF8.GetString(data);
Console.WriteLine(data_receive);
UdpClient client = new UdpClient();
IPEndPoint ep = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 7901);
byte[] bytes = Encoding.UTF8.GetBytes("成功!!!,.;");
client.Send(bytes, bytes.Length, ep);