create your own settings in xml

后端 未结 3 1598
渐次进展
渐次进展 2020-12-06 08:20

I\'m in a ASP.NET project where I need to give several parameters to the administrator that is going to install the website, like:

AllowUserToChangePanelLayo         


        
3条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-06 09:01

    I usually use Settings - available via the project properties - Settings. These can be edited and saved in code, and I write a form / web page to edit them.

    If you want to use the XML configuration, there's an attribute called file that reads external files. You could have a web.config file and a someothername.config file. The someothername.config would have settings like:

    
        
        
    
    

    And the web.config would have

    
    
        
            
        
    
    

    See DevX for the example I stole.

提交回复
热议问题