Specify more than one directory in Web.Config's Location Path element

前端 未结 4 1897
青春惊慌失措
青春惊慌失措 2020-12-03 20:54

In my ASP.NET\'s Web Config file I have the following location elements defined:

  
    
      

        
4条回答
  •  南方客
    南方客 (楼主)
    2020-12-03 21:31

    You cannot specify multiple elements in the path attribute, but you can make use of the configSource attribute.

    For example, the following original web.config file:

    
    
      
        
          
            
          
        
      
      
        
          
            
          
        
      
      
        
          
            
          
        
      
      
        
          
            
          
        
      
      
        
          
            
          
        
      
      
        
          
            
          
        
      
    
    

    Can be replaced by the following equivalent web.config, allow.config, and deny.config files:

    web.config

    
    
      
        
          
        
      
      
        
          
        
      
      
        
          
        
      
      
        
          
        
      
      
        
          
        
      
      
        
          
        
      
    
    

    allow.config

    
    
      
    
    

    deny.config

    
    
      
    
    

    The usefulness of this approach increases as the number of allow/deny rules in each section increases.

提交回复
热议问题