static Hashtable ht = new Hashtable();为什么有如下错误?
我这么写的语句:static Hashtable ht = new Hashtable();
为什么编译的时候,提示如下错误:
error CS0246: The type or namespace name 'Hashtable' could not be found (are you missing a using directive or an assembly reference?
是不是我忘记了引用其他的资源的原因 ?
[解决办法]
static System.Collections.Hashtable ht = new System.Collections.Hashtable();
using System.Collections;
[解决办法]
添加命名空间
using System.Collections;
[解决办法]
hashtable不是泛型 所以using System.Collections;
[解决办法]
引用程序集
[解决办法]
如果你用的VS2005,在ManualResetEvent上右键,记得是第一个选项之后会有USING出来,单击一下就自动帮你添引用了```
这台机子上没装```
[解决办法]
你是不是在namespace里直接构造的?
[解决办法]