下面我们来一步一步的搞定这个web.conifg,我想只要我们理解了web.config中基本的框架,也就是最常用,最基本的节点结构,原理,以后在也不怕了,开工
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="appSettings" type="System.Configuration.NameValueFileSectionHandler, System"/>
</configSections>
</configuration>
这个配置项是什么意思呢? name="appSettings"这里表示自定义的配置项键。也就是 appSettings
type="System.Configuration.NameValueFileSectionHandler, System" 表示 appSettings 这个自定义配置键的处理类是 System.Configuration.NameValueFileSectionHandler,后面的 System表示此类所在的 dll的名称。
<appSettings>
<add key="SystemFramework.Tracing.Enabled" value="False" />
〈/appSettings〉
也就是说我们在configSections中定义了配置项键,在配置文件后面就有与之对应的实现(也可以自定义配置节点,Duwamish就是很好的例子,大家可以细细的)
<configuration>
<configSections>
<section name="DuwamishConfiguration" type="Duwamish7.Common.DuwamishConfiguration, Duwamish7.Common" />
</configSections>
</configuration>
<DuwamishConfiguration> //注意这里就是自定义配置项节点了
<add key="Duwamish.DataAccess.ConnectionString" value="server=.;User ID=sa;Password=password;database=Duwamish;Connection Reset=FALSE" />
<add key="Duwamish.Web.EnablePageCache" value="True" />
<add key="Duwamish.Web.PageCacheExpiresInSeconds" value="3600" />
<add key="Duwamish.Web.EnableSsl" value="False" />
</DuwamishConfiguration>
好了,这部分就算玩了
分享到:
相关推荐
配置WEB.CONFIG连接数据库 ①providerName="System.Data.SqlClient" ----说明使用的是MSSQLServer数据库 ②providerName="System.Data.SqlLite" ----说明使用的是SQLLite数据库 ③providerName="System.Data.Oracle...
mybatis配置的重要文件包括mybatis-3-config.dtd mybatis-3-mapper.dtd
Web.config配置文件详解Web.config配置文件详解Web.config配置文件详解
部署描述文件web.xml详解(web-app_2_3.dtd),全面介绍: 1. icon元素 2. display-name元素 3. description元素 4. distributable元素 5. context-param元素 6. filter元素 7. filter-mapping元素 8. ...
python库。 资源全名:wwpdb.utils.config-0.21-py2.py3-none-any.whl
spring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot-config-yaml.jarspring-boot...
资源分类:Python库 所属语言:Python 资源全名:oslo.config-6.2.0-py2.py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059
对web.config进行增加修改删除的示例.rar
赠送jar包:spring-security-config-5.0.7.RELEASE.jar; 赠送原API文档:spring-security-config-5.0.7.RELEASE-javadoc.jar; 赠送源代码:spring-security-config-5.0.7.RELEASE-sources.jar; 赠送Maven依赖信息...
vue.config.js配置 内容概要:vue.config.js完整配置-超详细 适合人群:工作1-3年的前端人员
asp.net中web.config配置节点大全详解