using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using System.Threading.Tasks; namespace RuriLib.CaptchaServices { /// /// A WebClient with customizable timeout. /// public class CWebClient : WebClient { /// The maximum time to wait for a response. public int Timeout { get; set; } = 100; /// /// Gets the WebRequest. /// /// The uri /// The WebRequest protected override WebRequest GetWebRequest(Uri uri) { WebRequest w = base.GetWebRequest(uri); w.Timeout = Timeout * 1000; return w; } } }