BasicClass.cs 676 B

1234567891011121314151617181920212223
  1. using System.Net.NetworkInformation;
  2. using System.Threading.Tasks;
  3. namespace Team.Communicate.Helper
  4. {
  5. public class BasicClass
  6. {
  7. //检查PLC链接状况
  8. //public static bool PingCheck(string ip, int timeOut)
  9. //{
  10. // using Ping ping = new();
  11. // PingReply pr = ping.Send(ip, timeOut);
  12. // return pr.Status == IPStatus.Success;
  13. //}
  14. //public static async Task<bool> PingCheckAsync(string ip, int timeOut)
  15. //{
  16. // using Ping ping = new();
  17. // PingReply pr = await ping.SendPingAsync(ip, timeOut);
  18. // return pr.Status == IPStatus.Success;
  19. //}
  20. }
  21. }