<authentication mode="Forms">
        <forms name="name" loginUrl="1.aspx" protection="All" timeout="60">
         <!--非数据库比较
         <credentials passwordFormat="Clear | md5 | SHA1">
         <user name="a" password="123">
         <user name="b" password="123">
         -->
        </forms>
</authentication>
<authorization>
<allow user=""/>
        <deny users="?, User1"/> //*号所有  ?匿名
/authorization>


if (验证合法)
System.Web.Security.FormsAuthentication.redirectFromLoginPage(this.TextBox1.Text, this.CheckBox.Checked)
or
System.Web.Security.FormsAuthentication.setAuthCookies(this.TextBox1.Text, this.CheckBox.Checked)
Response.redirect("1.aspx")

登出
System.Web.Security.FormsAuthentication.SignOut()


配合非数据库
System.Web.Security.FormsAuthentication.Authenticate(用户名, 密码)

产生hash数据
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(password, format);

相关文章:

  • 2022-02-16
  • 2021-12-27
  • 2021-09-03
  • 2021-06-24
  • 2022-12-23
  • 2021-12-12
  • 2021-12-12
猜你喜欢
  • 2021-10-21
  • 2021-09-24
  • 2021-12-15
  • 2021-08-07
相关资源
相似解决方案