asp.net 调用外部应用程序
来源:互联网 发布:网络app软件能加盟吗 编辑:程序博客网 时间:2024/04/30 12:38
public string ExeCommand(string commandText)
...{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe"; //换成你要执行的
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string strOutput = null;
try
...{
p.Start();
p.StandardInput.WriteLine(commandText);
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
}
catch (Exception e)
...{
strOutput = e.Message;
}
return strOutput;
}
...{
Process p = new Process();
p.StartInfo.FileName = "cmd.exe"; //换成你要执行的
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string strOutput = null;
try
...{
p.Start();
p.StandardInput.WriteLine(commandText);
p.StandardInput.WriteLine("exit");
strOutput = p.StandardOutput.ReadToEnd();
p.WaitForExit();
p.Close();
}
catch (Exception e)
...{
strOutput = e.Message;
}
return strOutput;
}
- asp.net 调用外部应用程序
- asp.net调用外部exe程序
- ASP.NET应用程序中调用EJB
- ASP.NET应用程序中调用EJB
- ASP.NET应用程序中调用EJB
- qt4:调用外部应用程序
- C#调用外部应用程序
- java调用外部应用程序
- java 调用外部应用程序
- qt4:调用外部应用程序
- C#调用外部应用程序
- 外部应用程序调用Agent
- 外部应用程序调用Agent
- 外部应用程序调用Agent
- 外部应用程序调用Agent
- 外部应用程序调用Agent
- 【C#】调用外部应用程序
- java调用外部应用程序
- 如何充分利用ASP.NET 2.0预编译
- 抽象类
- erp的术语-jde系统
- 写一个外挂?
- java与面向对象---2.8 捕获音频及输出音频
- asp.net 调用外部应用程序
- 《C++ Templates 中文版》[陈伟柱译] 续1
- SQL SERVER存储过程批量插入数据库表数据
- vb 的 listbox学习心得
- 上司希望你明白的24件事
- 资料:韩剧《儿媳妇的全盛时代》剧情梗概
- 动态链接库(DLL)编程深入浅出(2)
- 《放羊的星星》全集在线观看
- 《C++ Templates 中文版》[陈伟柱译] 续2