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


  • 相关阅读:
    zipfile和tarfile的简单使用方法
    RabbitMQ安装
    postman接口自动化
    linux命令
    redis安装部署和使用
    nmon使用
    jdk自带监控工具配置使用
    修改本机mac
    hashlib模块,md5加密
    tomcat部署
  • 原文地址:https://www.cnblogs.com/gwazy/p/112643.html
Copyright © 2011-2022 走看看