62,268
社区成员
发帖
与我相关
我的任务
分享
<authentication mode="Forms">
<forms loginUrl="Login.aspx"></forms>
</authentication>
"Forms" 您为用户提供一个输入凭据的自定义窗体(Web 页),然后在您的应用程序中验证他们的身份。用户凭据标记存储在 Cookie 中。
<authorization>
<deny users="?" />
</authorization>
deny表示禁止,users="?"表示匿名用户
<location path="NewUser.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
public static bool AdminUserSessionTimeOut() //总后台判断用户是否登陆方法
{
HttpContext p = HttpContext.Current;
if (p.Session["AUserName"] == null)
{
//p.Response.Write("<div align='center'>未登陆或会话超时,请重新<a target='_self' href='../admin/Default.aspx'>登录</a>。</div>");
p.Response.Redirect("../Error/LoginError.htm");
p.Response.End();
return true;
}
return false;
}