1、webconfig
<system.web> <authentication mode="Forms"> <forms loginUrl="~/Admin/Login" timeout="2880"></forms> </authentication> </system.web>
增加下面的节点
2、认证
FormsAuthentication.SetAuthCookie(UserName, false);
3、获取当前认证的信息
string userName = System.Web.HttpContext.Current.User.Identity.Name;
4、登出
FormsAuthentication.SignOut();
标签:asp,启用,认证,FormsAuthentication,全过程,net From: https://www.cnblogs.com/sexintercourse/p/17155478.html