DCSIMG
Best Practices - Rotem Bloom's Blog

Rotem Bloom's Blog

Share knowledge on .NET and web development

News

About Me

Glad to help and share knowledge on .NET and also huge fan of Dream Theater.

Contact me via messenger

View Rotem Bloom's profile on LinkedIn

Dream Theater Pics

Blogs I Read

Browse by Tags

All Tags » Best Practices (RSS)
Working with WebClient object and Timeout
Hi, The WebClient object in .NET doesn't expose the request TimeOut property. In case you decided to use this object it is better to inherit from it and expose the TimeOut property. Example: public class SearchWebClient : WebClient { public SearchWebClient() { Timeout = 2000; } public SearchWebClient( int timeout) { Timeout = timeout; } /// <summary> /// Request timeout in milliseconds /// </summary> public int Timeout { get ; set ; } protected override WebRequest GetWebRequest( Uri...