protected void Page_Load(object sender, EventArgs e)
{
myclass=new someclass(this);//该类中有一个CheckSecurity函数
if(!someclass.CheckSecurity(3))//该函数通过则返回ture.代码在下
{
Response.Redirect("Default.aspx");//未通过验证,被拉回
};
..............................public bool CheckSecurity(int iLevel)
{
if (Int16.Parse(Session["UserRights"].ToString()) < iLevel){return false;}//在登陆框输入的时候就建立Session.
else return true;
}
{
myclass=new someclass(this);//该类中有一个CheckSecurity函数
if(!someclass.CheckSecurity(3))//该函数通过则返回ture.代码在下
{
Response.Redirect("Default.aspx");//未通过验证,被拉回
};
..............................public bool CheckSecurity(int iLevel)
{
if (Int16.Parse(Session["UserRights"].ToString()) < iLevel){return false;}//在登陆框输入的时候就建立Session.
else return true;
}
有什么安全不安全的?