执行dos命令后返回值 [英] Return value after a dos command execution

查看:89
本文介绍了执行dos命令后返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想执行以下dos命令:

Hi
I want to execute these dos commands:

ProcessStartInfo info = new ProcessStartInfo("batchisp");
info.Arguments = "-device at90usb1287 ... -operation addrange 00 read";
Process.Start(info);



现在我的问题很简单.我想要任何命令执行的返回值.例如,读取操作的返回值根据它来决定某某事物,或者验证操作的返回值来查看它是否成功.请写下您的答案,包括C#代码.谢谢!



Now my question is so simple. I want the return value of any command execution. For example the read operation''s return value to decide sth according to it or the verify operation''s return value to see if it was successfull. Please write your answer including c# code. Thanks!

推荐答案

请参阅

process myProcess=process.start("notepad.exe")
Console.WriteLine();
Console.WriteLine("Process exit code: {0}",myProcess.ExitCode);


这篇关于执行dos命令后返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆