■■■命名空间名称“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;
========
请指教 谢谢
相关推荐
找不到类型或命名空间名称“Server”(是否缺少 using 指令或程序集引用?)
今天将webserice里面的一个代码,拷到一个C#类,结果运行编译错误。DataBase = Server.MapPath(“data.mdb”);报错:找不到类型或命名空间名称“Server”(是否缺少 using 指令或程序集引用?)但是我的确引用了名字空间using System.Web;为什么呢?因为Server的完整路径是System.Web.HttpContext.Current.Server。using System.Web是显然不够的;但是在从内置Page类继承的类中可以直接写Server.MapPath”data.mdb”),应该是因为Page类已经包含了这些类路径。由此总
命名空间“System.Data”中不存在类型或命名空间名称“SqlServerCe”System.Data.SqlServerCe.dll
命名空间“System.Data”中不存在类型或命名空间名称“SqlServerCe” SqlCeConnection sqlceConn = new SqlCeConnection("server=.;database=db_Stream;uid=sa;pwd="); sqlceConn.Open(); SqlCeCommand sqlceCmd = new SqlCeCommand(sqlStr, sqlceConn); SqlCeDataReader sqlDr = sqlceCmd.ExecuteReader();
C# 操作excel出现"命名空间“Microsoft”中不存在类型或命名空间名称“Office ”(是缺少程序集引用吗?)"错误-附件资源
C# 操作excel出现"命名空间“Microsoft”中不存在类型或命名空间名称“Office ”(是缺少程序集引用吗?)"错误-附件资源
System.Web中不存在类型或命名空间名称“Optimization”(是否缺少程序集引用?)
主要为大家详细介绍了命名空间“System.Web”中不存在类型或命名空间名称“Optimization”的解决方法,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
HashSet的实现原理
HashSet的实现原理 ,HashSet与HashMap的区别 以及 HashSet的底层实现方式


