WebConfig配置
<system.web>
<authentication mode="Forms">
<forms loginUrl="login.aspx" />
</authentication>
<authorization>
<deny user="?" /><!--禁止匿名访问-->
</authorization>
</system.web>
//Logon.aspx
Logon_Click(Object sender,EventArgs e)
{
FormsAuthentication.RedirectFromLoginPage(username,IsCookie);
}
//LogonOut.aspx
LogonOut_Click(Object sender,EventArgs e)
{
FormsAuthentication.SignOut();
}
ASP.NET Forms 认证详解
106

被折叠的 条评论
为什么被折叠?



