比如:
http://topic.csdn.net/u/20110313/15/e7666fb2-8c23-4e6d-9d4b-3729d9e1d5b3.html
http://topic.csdn.net/u/20110313/15/4ae285ae-e364-4731-b419-974bab7d22af.html
上边两个网址。我只想要正文的内容。从:楼主发表于:2011-03-13 15:23:50去页头与页脚。谁弄过类似的?能给点代码或思路参考莫?
类似于搜索引擎的去重复。不过我只要简单的就行了。没那么高智商搞搜索那么复杂。
http://topic.csdn.net/u/20110313/15/e7666fb2-8c23-4e6d-9d4b-3729d9e1d5b3.html
http://topic.csdn.net/u/20110313/15/4ae285ae-e364-4731-b419-974bab7d22af.html
上边两个网址。我只想要正文的内容。从:楼主发表于:2011-03-13 15:23:50去页头与页脚。谁弄过类似的?能给点代码或思路参考莫?
类似于搜索引擎的去重复。不过我只要简单的就行了。没那么高智商搞搜索那么复杂。
安装方法1:通过用户界面安装 1.单击“开始”/“控制面板”/“程序”,选择“打开或关闭Windows功能”。
2.在Windows 功能对话框中,选中“Internet信息服务” 3.单击“确定”,这时Windows Vista就会启动IIS的安装过程; 注意,如果你用上述步骤安装,得到的是默认的安装,也就是最少的功能。如果你需要额外的IIS功能,如应用程序开发功能或者Web管理工具,就要在Windows功能对话框中,保证选中这些功能的相关复选框。 安装方法2:通过脚本安装 在脚本中输入如下的命令: start /w pkgmgr /iu:IIS-WebServerRole;IIS-WebServer;IIS- CommonHttpFeatures;IIS-StaticContent;IIS-DefaultDocument;IIS-DirectoryBrowsing;IIS- HttpErrors;IIS-HttpRedirect;IIS-ApplicationDevelopment;IIS-ASPNET;IIS- NetFxExtensibility;IIS-ASP;IIS-CGI;IIS-ISAPIExtensions;IIS-ISAPIFilter;IIS- ServerSideIncludes;IIS-HealthAndDiagnostics;IIS-HttpLogging;IIS-LoggingLibraries;IIS- RequestMonitor;IIS-HttpTracing;IIS-CustomLogging;IIS-ODBCLogging;IIS-Security;IIS- BasicAuthentication;IIS-WindowsAuthentication;IIS-DigestAuthentication;IIS- ClientCertificateMappingAuthentication;IIS-IISCertificateMappingAuthentication;IIS- URLAuthorization;IIS-RequestFiltering;IIS-IPSecurity;IIS-Performance;IIS- HttpCompressionStatic;IIS-HttpCompressionDynamic;IIS-WebServerManagementTools;IIS- ManagementConsole;IIS-ManagementScriptingTools;IIS-ManagementService;IIS- IIS6ManagementCompatibility;IIS-Metabase;IIS-WMICompatibility;IIS-LegacyScripts;IIS- LegacySnapIn;IIS-FTPPublishingService;IIS-FTPServer;IIS-FTPManagement;WAS- WindowsActivationService;WAS-ProcessModel;WAS-NetFxEnvironment;WAS- ConfigurationAPI 如果你用这个脚本安装,就会完全安装IIS,即安装全部的IIS功能。如果有些功能你不想用,应该编辑脚本文件,去除某个功能,如删除上面脚本中的倒数第三行的“IIS-LegacyScripts”,只安装你需要的程序包。 安装方法3:(图文)需要有win7的安装盘,不是gost版的,目前还没有发现有iis7.0安装包一、安装IIS默认情况下,windows7安装时是不会自动安装iis,只能手动安装。1.安装IIS开始-控制面板-程序-打开或关闭windows功能2.如图选择安装 VS2005 中,如果要调试站点的话,必须有“Windows身份验证” “摘要式身份验证” 是使用 Windows 域控制器对请求访问 Web 服务器上内容的用户进行身份证。“基本身份验证” 是要求用户提供有效的用户名和密码才能访问内容。要调试 ASP.net 当然要安装IIS支持 ASP.net 的组件了。二、配置IIS71、IIS7 在安装了上述组件后,控制面板-系统和安全-管理工具-Internet信息服务(IIS)管理工具,打开运行。如下图: 2、双击内页中的ASP,即显示ASP的设置内容,",然后在"Behavior(行为)"组中将"Enable Parent Paths(启用父路径)"设置为True即可。 3、配置默认网站 4、填写 物理路径、应用程序池,点OK即可: IIS 的应用程序池根据托管管道模式分了两种类型:集成和经典集成 .NET 模式下,应用程序不应在 <system.web>/<httpModules> 配置节中指定 ASP.NET 模块组件,而应使用 <system.webServer>/<modules> 配置节来加载 ASP.NET 模块组件。经典 .NET 模式 则是我们以前习惯的IIS 6 的方式,没有上述限制。 <script language="javascript" type="text/javascript" src="http://js.users.51.la/3728612.js"></script><noscript><a href="http://www.51.la/?3728612" target="_blank"><img alt="我要啦免费统计" src="http://img.users.51.la/3728612.asp" style="border:none" /></a></noscript>
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using System.IO.Compression;
using System.Text.RegularExpressions;namespace WikiPageCreater.Common
{
public class PageHelper
{
/// <summary>
/// 根据 url 获取网页编码
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public static string GetEncoding(string url)
{
HttpWebRequest request = null;
HttpWebResponse response = null;
StreamReader reader = null;
try
{
request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = 20000;
request.AllowAutoRedirect = false; response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK && response.ContentLength < 1024 * 1024)
{
if (response.ContentEncoding != null && response.ContentEncoding.Equals("gzip", StringComparison.InvariantCultureIgnoreCase))
reader = new StreamReader(new GZipStream(response.GetResponseStream(), CompressionMode.Decompress));
else
reader = new StreamReader(response.GetResponseStream(), Encoding.ASCII); string html = reader.ReadToEnd(); Regex reg_charset = new Regex(@"charset\b\s*=\s*(?<charset>[^""]*)");
if (reg_charset.IsMatch(html))
{
return reg_charset.Match(html).Groups["charset"].Value;
}
else if (response.CharacterSet != string.Empty)
{
return response.CharacterSet;
}
else
return Encoding.Default.BodyName;
}
}
catch
{
}
finally
{ if (response != null)
{
response.Close();
response = null;
}
if (reader != null)
reader.Close(); if (request != null)
request = null; } return Encoding.Default.BodyName;
} /// <summary>
/// 根据 url 和 encoding 获取当前url页面的 html 源代码
/// </summary>
/// <param name="url"></param>
/// <param name="encoding"></param>
/// <returns></returns>
public static string GetHtml(string url, Encoding encoding)
{
HttpWebRequest request = null;
HttpWebResponse response = null;
StreamReader reader = null;
try
{
request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = 20000;
request.AllowAutoRedirect = false; response = (HttpWebResponse)request.GetResponse();
if (response.StatusCode == HttpStatusCode.OK && response.ContentLength < 1024 * 1024)
{
if (response.ContentEncoding != null && response.ContentEncoding.Equals("gzip", StringComparison.InvariantCultureIgnoreCase))
reader = new StreamReader(new GZipStream(response.GetResponseStream(), CompressionMode.Decompress), encoding);
else
reader = new StreamReader(response.GetResponseStream(), encoding);
string html = reader.ReadToEnd(); return html;
}
}
catch
{
}
finally
{ if (response != null)
{
response.Close();
response = null;
}
if (reader != null)
reader.Close(); if (request != null)
request = null; } return string.Empty;
}
}
}