【问题标题】:C # How to check if a proxy server is working? [closed]C#如何检查代理服务器是否工作? [关闭]
【发布时间】:2023-03-30 05:45:02
【问题描述】:

请帮助如何检查代理服务器是否正常工作。如果它不起作用,它应该显示一条消息

【问题讨论】:

    标签: c# web proxy ip ping


    【解决方案1】:

    尝试 ping 它Ping Class

    static void Main(string[] args)
        {
            try
            {
                Ping myPing = new Ping();
                PingReply reply = myPing.Send("IP ADDRESS", 2000);
                if (reply != null)
                {
                    Console.WriteLine("Status: " + reply.Status + " \n Time: " + reply.RoundtripTime.ToString() + " \n Address: " + reply.Address);                   
                }
            }
            catch
            {
                Console.WriteLine("ERROR: TIMEOUT");
            }
            Console.ReadKey();
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-08
      • 1970-01-01
      • 2015-04-07
      • 1970-01-01
      • 1970-01-01
      • 2011-02-21
      • 1970-01-01
      • 2011-12-23
      相关资源
      最近更新 更多