tags:

views:

88

answers:

1

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

+3  A: 

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

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

There is a Ping class in .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;
    }
}
mafutrct