ASP.NET 的 Form验证

1。站点安全用户验证匿名即可

2。WebConfig:
<authentication mode="Forms">
   <forms loginUrl="logon.aspx" name=".ASPXFORMSAUTH">
   </forms>
  </authentication>
  <authorization>
   <deny users="?"/>
  </authorization> 

3。System.Web.Security.FormsAuthentication.RedirectFromLoginPage(strUserName, true);
登录转到访问页面,如:default.aspx,并建立user Cookie

4。System.Web.Page.User.Identity.IsAuthenticated
用于验证是否登录,登录为:True

5。退出登录
System.Web.Security.FormsAuthentication.SingOut();
posted @ 2006-11-14 20:41  疯一样的自由  阅读(372)  评论(0编辑  收藏  举报