■■■命名空间名称“HashSet”是什么? 如何解决■■■
我学习了你分享的这几篇好文
《忽略大小写的.NET脏字过滤算法 》http://www.cnblogs.com/xingd/archive/2008/02/04/1064549.html
,也尝试自己组合弄弄,便宜过程中发现一个错误一直想不到解决办法:
###############################
编译器错误信息: CS0246: 找不到类型或命名空间名称“HashSet”(是否缺少 using 指令或程序集引用?)
源错误:
行 17: public class ClearBadword
行 18: {
行 19: private HashSet<string> hash = new HashSet<string>();
行 20: private byte[] fastCheck = new byte[char.MaxValue];
行 21: private byte[] fastLength = new byte[char.MaxValue];
###############################
我的代码前面部分是这样写的:
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.Collections;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
/// <summary>
/// ClearBadword 的摘要说明
/// </summary>
public class ClearBadword
{
private HashSet<string> hash = new HashSet<string>(); private byte[] fastCheck = new byte[char.MaxValue];
private byte[] fastLength = new byte[char.MaxValue];
private BitArray charCheck = new BitArray(char.MaxValue);
private BitArray endCheck = new BitArray(char.MaxValue);
private int maxWordLength = 0;
private int minWordLength = int.MaxValue;
========
请指教 谢谢