开发者

How to read name-value attributes from an app.config file?

I am able to read the key-value attributes from the app.config file by using the following syntax.

System.Configuration.ConfigurationManager.AppSettings["ConfigurationFile"]

I want to read the name-value attributes from the app.config file which are defined under the following schema.

    <app开发者_运维问答licationsettings>
        <Host.Properties.Settings>
            <setting name="Path" serializeAs="String">
                <value>F:\PATH\</value>
            </setting>
        <Host.Properties.Settings>
    </applicationSettings>
</configuration>

What is the correct solution?


System.Configuration.ConfigurationManager.AppSettings["Path"]

or this:

Host.Properties.Settings.Default.Path

should work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜