【发布时间】:2013-05-24 18:08:23
【问题描述】:
我正在尝试运行PhantomJs.exe throw C# 代码。
我的代码:
Process process = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.WindowStyle = ProcessWindowStyle.Normal;
startInfo.FileName = "cmd.exe";
startInfo.WorkingDirectory = @"E:\";
startInfo.Arguments = "some string code here";
startInfo.CreateNoWindow = true;
process.StartInfo = startInfo;
process.Start();
当我运行它时,它会转到 WorkingDirectory E:/,但参数没有写在 cmd 提示符上。
有朋友可以建议我在 cmd.exe 上运行参数吗?
【问题讨论】:
-
你尝试过的字符串是什么?而不是
some string code here -
你如何确定 args 不写?
-
argument ="phantomjs highcharts-convert.js -infile options1.json -outfile chart1.png -scale 2.5 -width 300 -constr Chart -callback callback.js"
-
Tommi:代码运行压力很大,没有任何错误,但我传递的参数不是在命令提示符上写入/显示
-
所以进程会运行一段代码 cmd phantomjs highcharts-convert.js -infile options1.json -outfile chart1.png -scale 2.5 -width 300 -constr Chart -callback callback.js 为什么不启动phantomjs直接?