如何在 process.StartInfo.Arguments 中传递参数

问题描述

我正在使用 Process 从 .netcore 执行 dll。我在 CMD 中使用的命令是

c:/>./MyProject -c config.json

如何在 process.StartInfo.Arguments 中传递参数 = "-c config.json"。 config.json 是一个 json 文件

以下不起作用

using (var process = new Process())
{
     process.StartInfo.FileName = @"C:\MyProject";
     process.StartInfo.Arguments = "-c config.json"
     process.Start();
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)