Can anyone tell me the namespace for GetHtmlPage? I have:
using System.Net;
using System.IO;
as per the instructions found here: http://www.mikesdotnetting.com/Article/49/How-to-read-a-remote-web-page-with-ASP.NET-2.0
But this line of code:
string locatorReport = GetHtmlPage(URL);
throws an error message:
The name 'GetHtmlPage' does not exist in the current context
Any advice is appreciated.
Regards.
The code for
GetHtmlPageis in the article. You need to put it somewhere in your project, and call it from your code. (Having said which, it’s not really great code to start with…)Note that you’ll need to put it in a class. You could use the class that you’re calling it from, or put it somewhere else and use
where you use whatever name you’ve used for the class containing the method instead of
Foo. You’d want to make it an internal method too, of course.Alternatively, you could just use
WebClientinstead, with itsDownloadStringmethod…