ASP.NET中的应用程序配置

王朝asp·作者佚名  2006-01-09
宽屏版  字体: |||超大  

ASP.NET配置使用层次式配置体系结构。ASP.NET的所有配置信息都包含了在配置文件中,该文件为config.web,它位于与应用程序文件相同的目录中。除非子目录内的config.web文件覆盖了父目录的设置,否则,子目录降继承父目录的设置。

config.web文件为每种主要的ASP.NET功能提供了对应部分。

config.web文件中有关安全的内容如下所示:

<security>

<authentication mode=”[windows/cookie/passport/none]”>

<cookie cookie=”[name]” loginurl=”[url]” decryptionkey=”[key]”>

<credentials passwordformat =”[clear,shal,md5]”>

<user name=”[username]”password=”[password]”/>

</credentials>

</cookie>

<passport redirecturl=”internal”/>

</authentication>

<authorization>

<allow users=”[comma separated list of users]” roles=”[comma separated list of roles]”/>

<deny users=”[comma separated list of users]” roles=”[comma separated list of roles]”/>

</authentication>

<identity>

<impersonation enable =”[true/false]”/>

</identity>

</security>

这部分主要分为三部分:

»认证

»授权

»身份

通过应用程序根目录的应用程序配置文件中类似的一部分来覆盖计算机层次配置文件中的对应部分,就可以设置每个要素的值。所有子目录降自动继承设置,然而,子目录也可以通过覆盖其父目录的设置来拥有自己的配置文件。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有