简体   繁体   中英

Read file attribute from appsettings from web.config

In my web.config I have the following

<appSettings file="C:\\Config\\myproj\\Appsettings.Config">

file attribute doesn't come under NameValueCollection, so how can I read the file attribute? I want to read this attribute and then perform some operation.

This should give you the file path of the AppSettings file attribute:

ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None)
                    .AppSettings
                    .File;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM