At the end of last year (between Christmas and New Years), I had the task of auditing all the pages in an installation of Episerver. The problem was that the Service API wasn't installed and the possibility of deploying code to the server was pretty slim. This got me thinking about the feasible solutions.
Do you need to take screenshots of numerous web pages? Yes? Then this article is for you. You can take screenshots of web pages programmatically using the WebBrowser class (System.Windows.Forms). Let's get straight to the code.
In this article I'm going to show the usage of the HttpWebRequest and HttpWebResponse classes and how you can use it to interact with websites. I'm going to be focusing on retrieving text responses (or the source code of a web pages) and not binary files. I'm also not going to be mentioning WebClient or HttpClient, they may be an article for another time. At the end of the article I'm sharing a helper class.