public class WebClientEx : WebClient
{
public int Timeout {get; set;}
protected override WebRequest GetWebRequest(Uri address)
{
var request = base.GetWebRequest(address);
request.Timeout = Timeout;
return request;
}
}
Usage:
var myClient = new WebClientEx();
myClient.Timeout = 900000 // Daft timeout period
myClient.UploadData(myUri, myData);
artık ürettiğiniz metodu kullanıcaksınız webclientEx olucak yani ..