方法一:
string str1 = "0,1,2,3,4,5,6 ";
string[] str = str1.Split( ', ');
bool hasFlag=false;
foreach (string a in str)
{
if (a == "7 ")
{
hasFlag=true;
break;
}
}
if(hasFlag)
{ //执行当前页 }
else
{ //跳转 }
方法二
string [] flag = adminuser.Flag.Split('/');
List<string> list = new List<string>(flag);
if (list.Contains("9"))
Response.Write("当前操作用户"+adminuser.UserName.ToString());
else
Response.Write("<script>alert('您无权限进行此项操作');location.href='admin_main.aspx'</script>");