如何测试代理服务器是否正常工作? [英] How to test if a proxy server is working or not?

查看:60
本文介绍了如何测试代理服务器是否正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很大的列表,其中包含代理服务器及其相应的端口.我如何检查它们是否正常工作?

I've got a pretty big list with proxy servers and their corresponding ports. How can I check, if they are working or not?

推荐答案

工作吗?好吧,您必须使用它们来查看它们是否正常工作.

Working? Well, you have to use them to see if they are working.

如果要查看它们是否在线,我想 ping 是第一步.

If you want to see if they are online, I guess ping is a first step.

有一个 Ping类在.NET中.

using System.Net.NetworkInformation;

private static bool CanPing(string address)
{
    Ping ping = new Ping();

    try
    {
        PingReply reply = ping.Send(address, 2000);
        if (reply == null) return false;

        return (reply.Status == IPStatus.Success);
    }
    catch (PingException e)
    {
        return false;
    }
}

这篇关于如何测试代理服务器是否正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆