BaiduYunSync/NetDisk/PatientWebClient.cs
2017-02-05 16:11:10 +08:00

23 lines
475 B
C#

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;
}
}