【发布时间】:2017-09-15 17:31:05
【问题描述】:
应用程序的 user.config 文件可以在 C# 中通过以下方式访问 ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.PerUserRoamingAndLocal).FilePath
现在,我需要获取不同应用程序的 user.config,由其 exe 的完整路径标识,以便将当前应用程序 user.config 替换为该应用程序。
有什么建议吗?
编辑:请注意我对 user.config (ConfigurationUserLevel.PerUserRoamingAndLocal) 感兴趣,而不是 app.config 或 Application.exe.config 等应用程序级别设置。后者可由 OpenExeConfiguration(string) 访问,但不是我想要的。
【问题讨论】:
-
我用谷歌搜索了这个,但没有找到解决方案。而且它没有重复,因为我对应用程序级别的配置不感兴趣,但对用户级别的配置不感兴趣