易截截图软件、单文件、免安装、纯绿色、仅160KB

搜索之路 c#从html中提取文本

直接封装成一个类的,用起来还挺方便的
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text.RegularExpressions;
/// <summary>
/// HtmlExtract 抽取html里面的文本信息
/// </summary>
public class HtmlExtract
{
   
        #region private attributes
        private string _strHtml;
        #endregion
        #region public mehtods
         public HtmlExtract(string inStrHtml)
        { _strHtml = inStrHtml;}
        public string ExtractText()
        {
            string result = _strHtml;
            result = RemoveComment(result);
            result = RemoveScript(result);
            result = RemoveStyle(result);
            result = RemoveTags(result);
            return result.Trim();
        }
        #endregion
     #region private methods
       private string RemoveComment(string input)
{
string result = input;
//remove comment
result = Regex.Replace(result, @"<!--[^-]*-->", string.Empty, RegexOptions.IgnoreCase);
return result;
}
     


相关文档:

c# 验证码组件 可vb,asp,net调用

      今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
      csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......

html学习(常用属性)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; char ......

vim html xml 自动补全(在closetag.vim 上作了点修改)

当输入 》时自动补全 当输入《/时自动补全
“=================================
" File: closetag.vim
" Summary: Functions and mappings to close open HTML/XML tags
" Uses: <C-_> -- close matching open tag
" Author: Steven Mueller <di ......

如何抓取网页数据、分析并且去除Html标签(C#)

<@Aattention Content="本Blog原创文章,转载或引用请注明转载"
from="Robby.cnblogs.com"@>
      由于自己的搜索引擎中做到了这一块内容,所以今天说说如何抓取网页数据、分析并且去除Html标签,给大家提供一个参考。我的平台是Visual
Studio2005,C#。
& ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号