The webmaster wants to download other people's entire site data to their own website or to save some of their site's content to their own server. Extract the relevant fields from the content and publish them to your Web site system. Sometimes it is necessary to save the webpage related files to local, tablet, attachment and so on.
Image capture software can capture any site's various format pictures, to achieve all the articles, news, posts and other middle pictures all have a series of categories to save to your computer's best features, can be any forum website of all post pictures to local, easy to filter ads, etc., is the site, A must-have tool for forum owners and friends who like to collect beauty maps.
This article demonstrates using the C # WebBrowser control implementation to automatically identify the next page, categorized by title, and automatically downloaded (not duplicated), as shown in the 1 effect. The complete source code is provided in the accompanying code download.
Figure 1
Demo Program Structure
To create a demo program, I chose the new C#windows form application named Imgspider in Visual Studio 2013, and the Add Controls folder contains the encapsulated Label,textbox control The base class used by the dictionary entity in the core folder The Entity folder has a mapping class that reads the configuration file Dict.xml, the helper folder has downloadhelper for downloading the picture, Htmlparserhelper parsing html,xmlhelper reading the XML document, and the form file Frmautoborwser is the process The operating interface of the sequence. Figure 2 shows the overall structure of the demo program.
Program execution form File Frmautoborwser
The controls used in the form file Frmautoborwser,
First, the WebBrowser control
WebBrowser is a. NET control class that is new in the. NET Framework version 2.0. The WebBrowser class enables users to navigate a Web page in a form. Use the WebBrowser control to host Web pages and other browser-enabled documents in a Windows forms application. For example, you can use the WebBrowser control to provide integrated HTML-based user Help or Web browsing functionality in your application. In addition, you can use the WebBrowser control to add WEB-based existing controls to a Windows forms client application.
Second, the Timer control
By raising a timer event, the timer control can execute code once in a regular interval.
Third, the DataGridView control
Binding data to DataGridView controls is straightforward and straightforward, and in most cases, you simply set the DataSource property.
Click the Capture image button
The Webbrowser.navigate method navigates the Web page to the collection's starting URL. Note that the capture operation can continue only after the WebBrowser control has finished loading. The task that is collected after the WebBrowser control is loaded is performed at regular intervals through the timer control.
Gets the current page header URL to determine if it has been downloaded
Handling headers that need to be downloaded Url,webbrowser navigating to the specified URL
Gets the current caption picture URL, and Webborwser navigates to the next picture URL
Download images to determine whether to split by title, update Access database
The main way to DownLoadHelper.cs files is to
Download image
Main methods of HtmlParserHelper.cs files
First, get the current picture URL and the next picture URL
Second, get the current page URL and the next page URL
End
This article demonstrates the use of C # WebBrowser controls to implement picture capture software, auto-paging, automatic categorization (collection of the necessary tools for the beauty map), as shown in the 1 effect. The complete source code is provided in the accompanying code download. Complete source code Download link
C # picture capture software Auto-page Auto-classification (collect the necessary tools for the beauty map)