Guest User

Untitled

a guest
Jun 13th, 2012
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. WebClient timeout error
  2. public class WebDownload : WebClient
  3. {
  4. private int _timeout;
  5. /// <summary>
  6. /// Time in milliseconds
  7. /// </summary>
  8. public int Timeout
  9. {
  10. get
  11. {
  12. return _timeout;
  13. }
  14. set
  15. {
  16. _timeout = value;
  17. }
  18. }
  19.  
  20. public WebDownload()
  21. {
  22. this._timeout = -1;
  23. }
  24.  
  25. protected override WebRequest GetWebRequest(Uri address)
  26. {
  27. WebRequest result = base.GetWebRequest(address);
  28. result.Timeout = this._timeout;
  29. return result;
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment