string message = "0302";
byte[] sendbytes = Encoding.ASCII.GetBytes(message);
remoteIpep = new IPEndPoint(IPAddress.Parse(ip), 26); // 发送到的IP地址和端口号
sendUdpClient.Send(sendbytes, sendbytes.Length, remoteIpep);
转载于:https://www.cnblogs.com/VictorBlog/p/5193187.html