See here.
Put this in your App.config
:
<appSettings file="accessLevel.config"/>
And then have another file called accessLevel.config
like this:
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="TestSetting" value="TestValue"/>
</appSettings>
And then you can access your config values in code like this:
string value = ConfigurationManager.AppSettings["TestSetting"];
Make sure that accessLevel.config
is set to copy to the output directory (right click the file in Visual Studio -> Properties -> Copy To Output Directory -> Copy if Newer).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…