开发者

using elements in app.config file

Currently my app config settings are look like this

<appSettings>
    <add key="ConnectionString" value="server=localhost;user=;port=;" />
    <add key="MS" value="MSr" />
    <add key="MassagesTable" value="Massages" />
  </appSettings>

I want to add an 开发者_Python百科inner elements under "MassagesTable" with names columnOne and ColumnTwo. How I can do it , and them to read it from the code .

Currently I do it like ConfigurationManager.AppSettings["ConnectionString"];

Thanks for help.


You can find an example here: Custom type application settings in ASP.NET

Basically you can add any custom object as a setting, as long as you used 'typed settings' and the classes XML-serializable or have type converters. You should use applicaitonSettings section instead of appSettings for this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜