zoukankan      html  css  js  c++  java
  • 表单身份验证(受保护的目录)

    根目录下的 web.config
    <authentication mode="Forms">   <forms name=".COOKIEDEMO" loginUrl="bb.aspx" protection="All"
       timeout
    ="60" path="/"> 
          
    </forms> 
            
    </authentication>
     根目录下的. 
     bb.aspx
    if (this.TextBox1 .Text=="abc" &&  this.TextBox2 .Text=="abc")
                
    {
                    System.Web.Security .FormsAuthentication .RedirectFromLoginPage(
    this.TextBox1 .Text,false);
                    
                }

                
    else
                
    {

                }

      根目录下新建一个受保护的目录...
        这个目录下的 web.config 
      
    <configuration>
      
    <system.web>
        
    <authorization>
          
    <deny users="?" />
        
    </authorization>
      
    </system.web>
    </configuration>
     

    demo

      https://files.cnblogs.com/gwazy/WebApplication7.rar


  • 相关阅读:
    window.location无法跳转页面的问题
    html doctype作用
    ThinkPhp学习09
    ThinkPhp学习08
    ThinkPhp学习07
    ThinkPhp学习06
    ThinkPhp学习05
    Thinkphp学习04
    ThinkPhp学习03
    ThinkPhp学习02
  • 原文地址:https://www.cnblogs.com/gwazy/p/112643.html
Copyright © 2011-2022 走看看