02 2024 档案
摘要:有的时候,哪怕ip地址的格式是正确的,但是也有可能是一个不可到达的ip地址或者不在同一个子网,这种时候 如果不做处理,很有可能会导致程序的连接出现问题从而崩溃。 请尝试下面的代码: 1 static bool PingIPAddress(string ipAddress, string target
阅读全文
摘要:直接上代码 public static bool IsPortInUse(int port) { bool isPortInUse = false; IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalPrope
阅读全文