如何执行C#2008中提供开关的Dos命令 [英] How to execute dos commands giving switches in c# 2008
问题描述
朋友,
我有一个名为batchisp的exe文件(作为flip的一部分插入的文件).现在我要执行文件,以对其进行切换.例如,我要执行以下命令:
> batchisp-设备at90usb1287-硬件RS232-端口COM1-波特率115200
-operation擦除f loadbuffer"C:\ user \ dev \ test.hex"程序验证
如何在我的代码中包含dos开关,例如"-device at90usb1287".谢谢!
Hi friends,
I have got an exe file called batchisp ( a file that is instlled as a part of flip ). Now I wana execute the file giving switches to it. for example I wana execute this:
>batchisp -device at90usb1287 -hardware RS232 -port COM1 -baudrate 115200
-operation erase f loadbuffer "C:\user\dev\test.hex" program verify
How can I include dos switches like "-device at90usb1287" in my code. thanks!
推荐答案
ProcessStartInfo info = new ProcessStartInfo("batchisp");
info.Arguments = "-device at90usb1287";
Process.Start(info);
http://msdn.microsoft.com/en-us/library/system. diagnostics.processstartinfo.arguments.aspx [ ^ ]
http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.arguments.aspx[^]
这篇关于如何执行C#2008中提供开关的Dos命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!