In this paper, a very simple example of WinForm implementation of crawling Web page content, the code is simple and easy to understand, very practical! Share to everyone for your reference.
The specific implementation code is as follows:
WebRequest request = WebRequest.Create ("http://1.bjapp.sinaapp.com/play.php?a=" + pageurl); WebResponse response = Request. GetResponse (); Stream Resstream = Response. GetResponseStream (); StreamReader sr = new StreamReader (Resstream, System.Text.Encoding.UTF8); string htmlinfo = Sr. ReadToEnd (); Resstream.close (); Sr. Close ();
Interested friends can test run or improve the examples in this article. I hope this article is helpful to the study of C # program design.
In addition to the Declaration,
Running GuestArticles are original, reproduced please link to the form of the address of this article
WinForm implement method of crawling Web page content
This address: http://www.paobuke.com/develop/c-develop/pbk23470.html
Related content WinForm C # get the MAC address, IP address, subnet mask, instance of the default gateway in WPF dynamically load control instance code in XAML understanding C # Generating Verification code using C # to write an asynchronous socket server
C # Development of facial similarity calculation software source code Analysis C # generate random number instances C#?ùóúdbcontext (EF) êμ?? ͨó??? E??? 2éμ? Rest? ¨êμàyc# implements a class that gets the encoding of a text file (distinguishes between GB2312 and UTF8)
WinForm implement method of crawling Web page content