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

前端 未结 4 1541
走了就别回头了
走了就别回头了 2020-11-28 03:59

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.

4条回答
  •  鱼传尺愫
    2020-11-28 04:25

    You can use the WebClient

    WebClient client = new WebClient();
    string downloadString = client.DownloadString("http://www.gooogle.com");
    

提交回复
热议问题