This is my interview topic, borrowed a lot of online colleagues code, if offended, please Haihan!
Now the work is really difficult to find, I apply for the unit is http://www.027dns.net/, I hope the company manager can give me the opportunity to work, I will work very hard, because the software industry is my world! I was a college undergraduate as security guards have become colleagues jokes, hehe.
This is my first job search software industry, the first time to do the interview topic, the first time so seriously write blog articles, bad writing, please correct me, I will progress!
Zhang Sufung, reprint please indicate the source http://www.cnblogs.com/zhangsufeng/archive/2009/02/28/1400224.html
Say less, the text begins:
If we collect the Web site: http://info.laser.hc360.com/list/z_news_yw.shtml on the news, request to collect the title, time, content, a single article if the page is collected completely.
This type of collection is to get the news list (i.e. URL) from the specified Web page, then get the news details through its URL, this is a very common collection method, it is possible to collect on many pages, so we can use the interface to construct the base class.
First define IGatherInfo.cs
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5
6namespace classlibrary
7{
8/**////<summary>
9///News Collection class interface
///</summary& gt;
Interface Igatherinfo
/**////<summary>
14///Collection Time
15/// </summary>
string gathertime
{get
;
Set;
/**////<summary>
///Newslisturl: Extract page address
///regexstring: Regular table Tatsu-style, extract logic
24///Return to News page URL
///</summary>
list<string> Gatherurll IST (String Newslisturl, String regexstring);
27//Collect News details
list<newsdetail> gathernewsdetail (list<string> newsurllist,
string Re gexstring);
31}