从web.config的appsettings中读取文件属性

本文关键字:取文件属性 appsettings web config | 更新日期: 2023-09-27 18:12:17

在我的网页。配置我有以下

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

file属性不属于NameValueCollection,那么我如何读取file属性呢?我想读取这个属性,然后执行一些操作

从web.config的appsettings中读取文件属性

这应该会给你AppSettings文件属性的文件路径:

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