bool canExecute = true;
recvClient = new UdpClient(port);
IPAddress ip = IPAddress.Parse("224.100.0.1");
try
{
recvClient.JoinMulticastGroup(ip);
}
catch (Exception ex)
{
canExecute = false;
}
这里抛异常是因为,组播可能需要路由支持,(检查电脑联网没,连路由没)
C#网络编程之组播(JoinMulticastGroup),布布扣,bubuko.com
原文地址:http://www.cnblogs.com/gnsds/p/3731849.html