using System.Net.NetworkInformation; using System.Threading.Tasks; namespace Team.Communicate.Helper { public class BasicClass { //检查PLC链接状况 //public static bool PingCheck(string ip, int timeOut) //{ // using Ping ping = new(); // PingReply pr = ping.Send(ip, timeOut); // return pr.Status == IPStatus.Success; //} //public static async Task PingCheckAsync(string ip, int timeOut) //{ // using Ping ping = new(); // PingReply pr = await ping.SendPingAsync(ip, timeOut); // return pr.Status == IPStatus.Success; //} } }