ConfigurationManager.AppSettings["DataProviderAssembly"];

来源:百度知道 编辑:UC知道 时间:2024/06/01 01:13:53
ConfigurationManager.AppSettings["DataProviderAssembly"];
这个是读取webconfig的那个部位啊!
能不能全面的讲讲哦!
<cachingConfiguration defaultCacheManager="Cache Manager">
<cacheManagers>
<add expirationPollFrequencyInSeconds="80" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="Null Storage" name="Cache Manager"/>
</cacheManagers>
<backingStores>
<add encryptionProviderName="" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null" name="Null Storage"/>
</backingStores>
</cachingConfiguration>
你讲的我清楚,只不过是,下面有一些其他格式的webconfig我不太了解!

ConfigurationSettings.AppSettings
这样儿吧?

读取web.config中<configuration>标签内的:

<appSettings>
<add key="DataProviderAssembly" value="abcdefg"></add>
</appSettings>

上面回答的是正确的。
是<configuration>标签的。
这个玩意通常用来配置反射,根据配置反射你需要的对象。