I saw this piece of code:
var request = (HttpWebRequest) WebRequest.Create("http://www.google.com");
Why do you need to cast (HttpWebRequest)? Why not just use HttpWebRequest.Create? And why does HttpWebRequest.Create make a WebRequest, not a HttpWebRequest?