WinForm implement method of crawling Web page content

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.