asp.net的forms身份验证 单用户身份验证
首先要配置Web.config文件
<system.web>
?????<authentication mode="Forms">
???????<forms loginUrl="logon.aspx" name=".ASPXFORMSAUTH">
???????</forms>
?????</authentication>
?????<authorization>
???????<deny users="?" />
?????</authorization>
???</system.web>
创建Logon.aspx 和 Default.aspx两个页面
授权
FormsAuthentication.SetAuthCookie(UserEmail.Text,true);
或者
???????????????FormsAuthentication.RedirectFromLoginPage(UserEmail.Text, true);
取得身份信息
Context.User.Identity.Name
或
判断 Request.IsAuthenticated
asp.net的forms身份验证 单用户身份验证
原文地址:http://www.cnblogs.com/luoluohua/p/7746767.html