习俗科是一种可贵的工具。 用于严重 app料的护料。
Here is code for custom section
IN WEB.CONFIG
<configuration>
<configSections>
<section name="Misc" type="Config"/> <<-- this registers a custom section called Misc
<Misc configSource="config_misc.config"/> <<-- this says to look for for it in file "config_misc.config"
(...)
之后又创建了CONFIG_MISC。 CONFIG 贵国网站的根基,并将其列入
<Misc
MySetting1="true"
/>
TheN in You webapp, in App_CODE rafter, Creat a section such:
using System;
using System.Collections;
using System.Configuration;
using System.Xml;
using System.Collections.Specialized;
public class Config : ConfigurationSection
{
private static string _CONFIG_SECTION = "Misc";
#region singleton implementation
private static Config _config;
static Config()
{
_config = (Config)ConfigurationSettings.GetConfig(_CONFIG_SECTION);
}
#endregion
public static bool MySetting1
{
get
{
return _config._MySetting1;
}
}
#region public properties the define the config items we are looking for
[ConfigurationProperty("MySetting1", IsRequired = false)]
public bool _MySetting1
{
get
{
return (bool)this["MySetting1"];
}
}
#endregion
}
这部法典是我的法典的复印件,同时予以废除,即可能犯错,但应该开始。
现在,你只是通过“儒瓦”来达到你的环境,是一种非常简单的方式。 MySetting1
没收档案也有许多好处,特别是在维护和组合方面。