...
<authentication mode="Forms" >
<forms name=".ASPXUSER" loginUrl="AdminLogin.aspx" protection="All" timeout="60" />
</authentication>
</system.web>
<location path="Management">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>
...
在代码中按普通方式,例如要求对方输入信息查找数据库或者XML进行验证,验证通过后,执行这句就表示验证通过同时跳会开始进入的页面
System.Web.Security.FormsAuthentication.RedirectFromLoginPage(userName,true);
注销用 System.Web.Security.FormsAuthentication.SignOut();
如果不想跳回原处,可以先授权再redirect到其他页面 System.Web.Security.FormsAuthentication.SetAuthCookie();