You could use the Timeout property:
var request = (HttpWebRequest)WebRequest.Create("http://www.google.com");
request.Timeout = 1000;
using (var stream = request.GetResponse().GetResponseStream())
using (var reader = new StreamReader(stream))
{
Console.WriteLine(reader.ReadToEnd());
}
UPDATE:
To answer the question in the comment section about XElement.Load(uri)
you could do the following:
var request = (HttpWebRequest)WebRequest.Create("http://stackoverflow.com/feeds");
request.Timeout = 1000;
using (var stream = request.GetResponse().GetResponseStream())
using (var reader = new StreamReader(stream))
{
var xel = XElement.Load(reader);
}