Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- WebClient timeout error
- public class WebDownload : WebClient
- {
- private int _timeout;
- /// <summary>
- /// Time in milliseconds
- /// </summary>
- public int Timeout
- {
- get
- {
- return _timeout;
- }
- set
- {
- _timeout = value;
- }
- }
- public WebDownload()
- {
- this._timeout = -1;
- }
- protected override WebRequest GetWebRequest(Uri address)
- {
- WebRequest result = base.GetWebRequest(address);
- result.Timeout = this._timeout;
- return result;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment