博客园  :: 联系 :: 管理

网页调用进程

Posted on 2006-06-22 11:38  独孤雁  阅读(200)  评论(0编辑  收藏  举报

打开文件或目录


using System.Diagnostics;
Process.Start(OpenFullPath);



using System.Diagnostics;
Process ps=new Process();
ps.StartInfo.FileName=@"E:\CSharp3\QXKMeTone\bin\Debug\cardtest.exe";
ps.Start();

带参数

Process.Start("OpenFullPath","参数");



返回网页接收可执行程序返回值
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "test.exe";
p.Start();
p.WaitForExit();
string output = p.StandardOutput.ReadToEnd();

注:控制台程序进行标准输出