How to get html of web page in string by web page url

           Hi friends sometimes we need a content of web page like text or links and many more things.then we use the html of page by inspect elements.

           Now that we do by c# code.this work on both web and window application.

First include library of "using System.Net;"

Second code for one line.
string strhtml = new WebClient().DownloadString("http://facebook.com");

This returns string of all web page html in string.

We can manipulate string and get we require content.


Comments

Popular posts from this blog

Populate combo box for month and year in c#

How to get month days count from date or month and year

CRUD Operations in win form application with access database