BaiduYunSync/NetDisk/PatientWebClient.cs

23 lines
475 B
C#
Raw Normal View History

2017-02-05 16:11:10 +08:00
using System;
using System.Net;
class PatientWebClient : WebClient
{
public int Timeout = 300000;
public PatientWebClient(int Timeout): base()
{
this.Timeout = Timeout;
}
public PatientWebClient() : base()
{
}
protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest w = base.GetWebRequest(uri);
w.Timeout = Timeout;
(w as HttpWebRequest).ReadWriteTimeout = Timeout;
return w;
}
}