| 123456789101112131415161718192021222324252627282930313233343536 |
- using System;
- using System.Net;
- namespace Muchinfo.MTPClient.Infrastructure.Utilities
- {
- public class MyWebClient : WebClient
- {
- private int _timeOut;
- public int TimeOut
- {
- get
- {
- return _timeOut;
- }
- set { _timeOut = value; }
- }
- public MyWebClient()
- {
- this._timeOut = 30*1000;
- }
- public MyWebClient(int timeOut)
- {
- this._timeOut = timeOut;
- }
- protected override WebRequest GetWebRequest(Uri address)
- {
- var result = base.GetWebRequest(address);
- result.Timeout = this.TimeOut;
- return result;
- }
- }
- }
|