以下代码有什么错误 [英] What error in following code

查看:102
本文介绍了以下代码有什么错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码的目的:
我想运行emgscan.exe<驱动器名称=" which =" we =" want =" to =" scan =">从我的Windows应用程序中的命令提示符.
假设我要扫描D驱动器,并且emgscan.exe的位置为C:\ Document,然后我们使用以下syntex扫描D驱动器.

C:\ Document> emgscan.exe D:\

上面的命令在命令提示符下成功运行,但是在Windows应用程序中使用时出错.该应用程序的代码如下.

System.Diagnostics.Process.Start("cd//");
System.Diagnostics.Process.Start("cd文档");
System.Diagnostics.Process.Start("emgscan.exe" + sorce.FullName);



未指定错误,但未找到路径................

Purpose Of this code:
I want to run emgscan.exe <drive name="" which="" we="" want="" to="" scan=""> from command prompt in my windows application.
Suppose i want to scan d drive and location of emgscan.exe is C:\Document then we scan the D drive using the following syntex.

C:\Document>emgscan.exe D:\

Above command successfully run on command prompt, but error when we use in windows application. code of this application is following.

System.Diagnostics.Process.Start("cd//");
System.Diagnostics.Process.Start("cd Document");
System.Diagnostics.Process.Start("emgscan.exe " + sorce.FullName);



error is specified path is not found................

推荐答案

尝试以下操作;
Try the following;
System.Diagnostics.Process.Start("C:\\Document\\emgscan.exe", sorce.FullName);



另请阅读有关Process.Start(字符串,字符串)的msdn文章 [



Also read this msdn article on Process.Start(string, string)[^]


这篇关于以下代码有什么错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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