You can also use the System.Net.HttpWebRequest
implementation of System.Net.WebRequest
. It comes packaged with a timeout property - http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx.
It would be a simple call to the object:
...
using System.Net;
...
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(new Uri("www.microsoft.com"));
webRequest.Timeout = 10000;
HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
...