c# - 修改不同exe的App.Config中的AppSettings

标签 c# .net app-config

我有一个 C# .NET 控制台应用程序 exe,其中的 app.config 指定了一些用作参数的 ApplicationSettings。

我有一个额外的单独(Windows 窗体)exe(位于同一目录中)以允许用户修改第一个 exe 使用的 ApplicationSettings。

从第二个 exe 修改第一个 exe 的 app.config 的最干净的方法是什么?

谢谢。

最佳答案

你可以使用

public static Configuration OpenExeConfiguration(
    string exePath
)

MSDN Link

关于c# - 修改不同exe的App.Config中的AppSettings,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/974953/

相关文章:

c# - 更新 Entity Framework 6 中的多对多导航属性,更改未保存

c# - AppSettings 清除 app.config 中的 Xml 元素

"save as"网页及离线浏览的C#工具

c# - 编译器会优化两次创建此列表吗?

c# - C# Windows 应用程序中的密码散列,缺少 ASP.NET 的 FormsAuthentication?

c# - 网站地址验证的正则表达式

c# - configSource 绝对路径解决方法

visual-studio - Visual Studio 变量可用于配置文件?

c# - ClickOnce UNC 命令行

c# - 为什么我的代码在每个可能的点都关闭它后仍然在进行延迟加载?