public static void SendData(string host, int port, byte[] sendBytes) { UDPClient client = new UDPClient(host, port); client.Connect(); client.SendData(sendBytes); client.DisConnect(); }
public static void SendData(string data) { byte[] sendBytes = Encoding.ASCII.GetBytes(data); UDPClient client = new UDPClient(h, p); client.Connect(); client.SendData(sendBytes); client.DisConnect(); }