易截截图软件、单文件、免安装、纯绿色、仅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;
}
     


相关文档:

java的Qname在C#中对应的是什么

首先了解一下什么是Qname
下面是一篇写的比较好的关于Qname的介绍:
http://blog.csdn.net/fbysss/archive/2007/06/24/1664076.aspx
可见Qname主要是处理namesapce的,是指具有特定前缀的xml element。而且Qname就是QualifiedName的缩写,所以Qname在C#中对应的应该是XmlQualifiedName这个类 ......

基于Spring框架发送HTML格式的邮件

// 抽象类 package com.albert.email.mime; import org.springframework.mail.javamail.JavaMailSender; public abstract class AbstractMessageSender {
    protected String from;
    protected String to;
    protected String subject; ......

C#开发XML WebService接口(SOAP)

原文链接:http://www.cnblogs.com/ding0910/archive/2007/07/12/815407.html
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using BX.Interface; ......

C# 连接Oracle数据库


C#连接Oracle数据库字符串
http://developer.51cto.com
 2009-08-20 17:55  佚名  百度空间  我要评论(
0
)
C#连接Oracle数据库以及C#连接Oracle数据库字符串等内容将在本文中展现,希望本文能对大家了解C#连接数据库有所帮助。
C#连接Oracle数据库字符串(查询数据)
using
 Syst ......

html表格标记

HTML有10个表格相关标签。下面是一个带有简介的列表,但是首先,文档要被正确的定义在HTML 4.01/XHTML 1或HTML 5下面:
<caption> 定义表格标题(4, 5)
<col> 为表格的列定义属性(4, 5)
<colgroup> 定义表格列的分组(4, 5)
<table> 定义表格(4, 5)
<tbody> 定义表格主体(4, 5)
< ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号