C#调用外部可执行exe文件
2010-05-07 09:56
381 查看
//调用外部程序导cmd命令行
Process p = new Process();
p.StartInfo.FileName
= "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput
= true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow
= false;
p.Start();
/ /向cmd.exe输入command
p.StandardInput.WriteLine("cd
C
://Inetpub//wwwroot//Paicdom//PaWebService//PaWeb//Manage//Exportcsv");
//cmd
又调用了ociuldr.ex
p.StandardInput.WriteLine("ociuldr.exe user=******/******@ordb
query=/""+sqlStr+"/" field=, file=dataExported.csv");
p.StandardInput.WriteLine("exit");
//需要有这句,不然程序会挂机
//string output = p.StandardOutput.ReadToEnd();
这句可以用来获取执行命令的输出结果
我在ASP.NET中调用,一直想看看到执行窗口,但无论怎么设置参数,都看不到。不知如何。
http://zhijin.javaeye.com/blog/259846
Process p = new Process();
p.StartInfo.FileName
= "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput
= true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.CreateNoWindow
= false;
p.Start();
/ /向cmd.exe输入command
p.StandardInput.WriteLine("cd
C
://Inetpub//wwwroot//Paicdom//PaWebService//PaWeb//Manage//Exportcsv");
//cmd
又调用了ociuldr.ex
p.StandardInput.WriteLine("ociuldr.exe user=******/******@ordb
query=/""+sqlStr+"/" field=, file=dataExported.csv");
p.StandardInput.WriteLine("exit");
//需要有这句,不然程序会挂机
//string output = p.StandardOutput.ReadToEnd();
这句可以用来获取执行命令的输出结果
我在ASP.NET中调用,一直想看看到执行窗口,但无论怎么设置参数,都看不到。不知如何。
http://zhijin.javaeye.com/blog/259846
相关文章推荐
- C#调用外部可执行exe文件
- ASP.NET、C#调用外部可执行exe文件--多种方案
- C# 调用exe 执行文件时附带参数
- C#调用可执行文件(.bat,.exe...)
- JAVA 和 C# 调用外部.exe文件,传值并等等exe完成,获取返回值
- VFP调用外部Exe文件,执行完后,再接着执行本程序(经典转载)
- Matlab程序调用外部exe(可执行文件)方法及参数传递
- ASP.NET中使用C#调用服务器端exe可执行文件
- C#程序调用Delphi可执行EXE文件过程
- C# 调用本地EXE可执行文件并捕获EXE终止动作
- c# 打开外部可执行文件exe。
- 初学c# -- c#创建开机自启服调用外部交互式exe文件
- 让Delphi使用带参数来调用外部可执行文件(EXE文件)
- C#调用EXE文件(window程序可以,web没能调试成功)
- C#调用cmd.exe程序和外部程序
- net C#如何调用EXE文件
- c#调用EXE文件方法
- C#调用外部exe作为子窗体或UI? VC++如何实现呢呢?...札记plus
- C#中利用Process类调用外部程序以及执行Dos命令
- C# 调用外部exe程序,出现已停止工作