public void send(string ip, int port, string data)
{
try
{
UdpClient udpcSend = new UdpClient();
byte[] byteArray = System.Text.Encoding.Default.GetBytes(data);
IPEndPoint remoteIpep = new IPEndPoint(IPAddress.Parse(ip), port);//发送到的端口号以及IP地址
udpcSend.Send(byteArray, byteArray.Length, remoteIpep);//发送
}
catch (Exception ex)
{
; //log.Info(ex);
}
}