在C#板块问了没人理,来PHP板块试试.
我想在C#中使用PHP的CLI命令,我用下面的C#代码 调用php.exe 并传入参数 ,但是获取不到返回值.麻烦各位有懂的帮我看下
string path = Application.StartupPath + "\\php.exe";
//Process.Start(path, " -f \"" + Application.StartupPath + "Interface.php \"");
ProcessStartInfo psi = new ProcessStartInfo(path, " -f \"" + Application.StartupPath + "a.php 2010 12\"");
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = Process.Start(psi);
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
textBox1.Text = output;我在网上找了好久都没有找到C#中使用CLI的代码,一行都找不到,谁能给个示例代码 不胜感激!
我想在C#中使用PHP的CLI命令,我用下面的C#代码 调用php.exe 并传入参数 ,但是获取不到返回值.麻烦各位有懂的帮我看下
string path = Application.StartupPath + "\\php.exe";
//Process.Start(path, " -f \"" + Application.StartupPath + "Interface.php \"");
ProcessStartInfo psi = new ProcessStartInfo(path, " -f \"" + Application.StartupPath + "a.php 2010 12\"");
psi.RedirectStandardOutput = true;
psi.UseShellExecute = false;
Process p = Process.Start(psi);
string output = p.StandardOutput.ReadToEnd();
p.WaitForExit();
textBox1.Text = output;我在网上找了好久都没有找到C#中使用CLI的代码,一行都找不到,谁能给个示例代码 不胜感激!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货