0

Possible Duplicate:
C# Connecting Through Proxy

I've tried doing this for a long time in many different ways but nothing seems to work. Essentially I want to create a proxy checker in C# that checks it by actually going to a page (e.g. http://google.com/ncr) and determines from there if it got there or not.

Is this even possible?

Community
  • 1
  • 1
Bill Dekel
  • 47
  • 3
  • 10
  • Theres already so many examples for it. Just try setting your proxy in the following [MSDN code](http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.proxy.aspx) . – perilbrain Sep 01 '12 at 20:49

1 Answers1

0

If it is a http proxy

bool OK = false;
try
{
    WebClient wc = new WebClient();
    wc.Proxy = new WebProxy(Host, Port);
    wc.DownloadString("http://google.com/ncr");
    OK = true;
}
catch{}
L.B
  • 114,136
  • 19
  • 178
  • 224