![](/img/trans.png)
[英]How do I get my c# console application to run with an app.config?
[英]How do I get my application to choose between two app.config files?
我想创建两个app.config文件,然后让用户通过命令行参数决定使用哪个文件。 如何使我的应用程序在代码中使用一个.config或另一个?
我正在使用由配置文件设置的设置文件。 有两种可能的配置,如果用户只需键入“> myprogram -live”或“> myprogram -test”,然后程序选择要从中加载哪个配置文件,就会更容易。 谢谢!
复制两个具有不同名称的exe文件:
myprogram.live.exe
myprogram.live.config
myprogram.test.exe
myprogram.test.config
然后,您可以选择启动myprogram.live
或myprogram.test
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.