在.net Windows应用程序上运行DOS命令时出错 [英] Error when running DOS command on .net windows application

查看:81
本文介绍了在.net Windows应用程序上运行DOS命令时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

System.Diagnostics.Process.Start("C:\\ Project \\ emgscan.exe","G:\\");

上面的语句运行成功,但是我想按我的意思执行它.

1.它创建了一个用于扫描驱动器的新进程,并且其他语句正在与并行进程一起执行.在扫描过程完成之前,我不想执行下一条语句.

2.我不想向用户显示命令提示符.

System.Diagnostics.Process.Start("C:\\Project\\emgscan.exe","G:\\");

Above statement run successfully but i want to execute it according me like this.

1. it create a new process for scanning the drive and other statement is executing with parallel process. I don''t want to execute next statement until my scan process is completed.

2. I don''t want to show the command prompt to user.

推荐答案

创建Process类的对象.然后使用StartInfo.WindowStyle属性和Process.WaitForExit方法.
Create an object of Process class. Then use StartInfo.WindowStyle property and Process.WaitForExit method.


这篇关于在.net Windows应用程序上运行DOS命令时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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