string ipAddress = GetParamValue("IpAddress", "192.168.1.2");
int? port = GetParamIntValue("Port", 300);
if (string.IsNullOrEmpty(ipAddress))
{
thrownew Exception("IpAddress配置不正确。");
}
if (!port.HasValue)
{
thrownew Exception("Port配置不正确。");
}
//Ping
Ping p =new Ping();
try
{
PingReply reply
= p.Send(ipAddress, 2000);
if (reply.Status == IPStatus.Success) return "连接成功!";
}
catch (Exception)
{
}
return"连接失败,请检查IP时候配置正确!";

  

编辑器加载中...

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-08
  • 2022-01-07
  • 2021-05-12
  • 2021-07-22
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
相关资源
相似解决方案