Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How I can get web page's content and save it into the string variable

How I can get the content of the web page using ASP.NET? I need to write a program to get the HTML of a webpage and store it into a string variable.

like image 582
kamiar3001 Avatar asked Dec 22 '10 14:12

kamiar3001


1 Answers

You can use the WebClient

Using System.Net;      WebClient client = new WebClient(); string downloadString = client.DownloadString("http://www.gooogle.com"); 
like image 55
dhinesh Avatar answered Sep 28 '22 02:09

dhinesh