coolerfarmer

Untitled

Jul 1st, 2014
5,476
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. using (HttpClientHandler handler = new HttpClientHandler())
  2. {
  3. handler.Proxy = new WebProxy(proxy.IP);
  4. handler.UseProxy = true;
  5. using (HttpClient client = new HttpClient())
  6. {
  7. client.Timeout = TimeSpan.FromMilliseconds(Timeout);
  8. Stopwatch sw = new Stopwatch();
  9. sw.Start();
  10. string responseString = client.GetStringAsync(ProxyJudgeUri).Result;
  11. sw.Stop();
  12. proxy.Timeout = sw.ElapsedMilliseconds;
Advertisement
Add Comment
Please, Sign In to add comment