我是一个.net的新手,我现在在测试书上的一个系统,但是编译的时候出现问题有哪个高手可以帮一下?public ST_Identity Identity
{
get { return _identity; }
}
public bool IsInRole(string role)
{
int num1;
if (role == string.Empty || role == null)
throw new ArgumentNullException("role");
if (_roles == null)
{
return false;
}
for (num1 = 0; (num1 < _roles.Length); num1 += 1)
{
if (_roles[num1] == "Adminstrators")
return true;
if ((_roles[num1] != null) && (string.Compare(_roles[num1], role, true, CultureInfo.InvariantCulture) == 0))
{ return true; }
}
return false;
}
错误 1 当前上下文中不存在名称“CultureInfo” D:\我的文档\Visual Studio 2005\WebSites\ST_WebExam\App_Code\ST_Principal.cs 63 85 D:\...\ST_WebExam\
{
get { return _identity; }
}
public bool IsInRole(string role)
{
int num1;
if (role == string.Empty || role == null)
throw new ArgumentNullException("role");
if (_roles == null)
{
return false;
}
for (num1 = 0; (num1 < _roles.Length); num1 += 1)
{
if (_roles[num1] == "Adminstrators")
return true;
if ((_roles[num1] != null) && (string.Compare(_roles[num1], role, true, CultureInfo.InvariantCulture) == 0))
{ return true; }
}
return false;
}
错误 1 当前上下文中不存在名称“CultureInfo” D:\我的文档\Visual Studio 2005\WebSites\ST_WebExam\App_Code\ST_Principal.cs 63 85 D:\...\ST_WebExam\
如果不记得的话,将鼠标移到CultureInfo,出现波浪线的左下方,会弹出需要引用的命名空间,你选择一下即可。