// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Net; using System.Net.Sockets; using System.Linq; namespace E { public class Client { public static void Main(string[] args) { UdpClient cli = new UdpClient(12346); byte[] b = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17 }; IPAddress addr = Dns.GetHostAddresses("localhost").First(a => a.AddressFamily == AddressFamily.InterNetwork); Console.WriteLine(addr); cli.Send(b, b.Length, new IPEndPoint(addr, 12345)); cli.Close(); } } }