To read html from a url, you have to make HttpWebRequest.
First make HttpWebRequest and add url in it.
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create("http://www.yourdomain.com/filename-1.html");
Now Specify timeout and UserAgent
httpRequest.Timeout = 10000; // 10 secs httpRequest.UserAgent = "Code Sample Web Client";
Now get a response in HttpWebResponse and from HttpWebResponse you will get your html.
HttpWebResponse webResponse = (HttpWebResponse)httpRequest.GetResponse(); StreamReader responseStream = new StreamReader(webResponse.GetResponseStream()); string FileMatter = responseStream.ReadToEnd();
In FileMatter variable you will get all html from given url.
Code
HttpWebRequest httpRequest = (HttpWebRequest)WebRequest.Create("http://www.yourdomain.com/filename-1.html"); httpRequest.Timeout = 10000; // 10 secs httpRequest.UserAgent = "Code Sample Web Client"; HttpWebResponse webResponse = (HttpWebResponse)httpRequest.GetResponse(); StreamReader responseStream = new StreamReader(webResponse.GetResponseStream()); string FileMatter = responseStream.ReadToEnd();