// 1.创建套节字
m_s = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);
// 2.填写服务器IP
IPAddress ip = IPAddress.Parse("127.0.0.1");
IPEndPoint ipe = new IPEndPoint(ip, 4321);
string welcome = "你好呀...";
byte[] data = new byte[1024];
data = Encoding.Unicode.GetBytes(welcome);
// 3.发送数据
m_s.SendTo(data, data.Length, SocketFlags.None, ipe);
Console.ReadKey();