本文介绍了启动功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个命令行:

myUtility.exe -1 -x myUtility.xml C:\Temp \ MyDoc.doc C:\Temp \ MyDoc。 txt


它在命令提示符下工作正常(即DOS提示符),它将doc

文件转换为测试文件。


但是,如果我在C#中运行:


System.Diagnostics.Process.Start(" myUtility.exe"," -1 -x myUtility.xml " +

@" C:\Temp \ MyDoc.doc" +">" + @" C:\ Temp \ MyDoc.txt");


无法创建输出文本文件。


有什么想法吗?


我放了myUtility.exe进入我的C#可执行目录,所以它能够找到这个以及xml文件的
。另外,没有异常提出

因此我认为它已成功执行。


I have a command line:

myUtility.exe -1 -x myUtility.xml C:\Temp\MyDoc.doc C:\Temp\MyDoc.txt

It works fine in the command prompt (ie. DOS prompt), it converted a doc
file into test file.

However, if I run in C#:

System.Diagnostics.Process.Start("myUtility.exe", "-1 -x myUtility.xml " +
@"C:\Temp\MyDoc.doc" + " >" + @"C:\Temp\MyDoc.txt");

That failed to created a output text file.

Any idea?

I put the myUtility.exe into my C# executable directory, so it is able to
find this and also the xml file. In addition, there is no exception raised
so I think it is executed successfully.



推荐答案






尝试:


System.Diagnostics.Process.Start(" cmd"," / c myUtility.exe -1 -x

myUtility.xml" +

@" C:\Temp \ MyDoc.doc" +">" + @" ; C:\ Temp \ MyDoc.txt");

ARne

Try:

System.Diagnostics.Process.Start("cmd", "/c myUtility.exe -1 -x
myUtility.xml " +
@"C:\Temp\MyDoc.doc" + " >" + @"C:\Temp\MyDoc.txt");
ARne


这篇关于启动功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 22:27