Shell(VB6)和System.Diagnostics.Process.Start()

时间:2017-11-09 11:32:12

标签: vb.net shell vb6

我被困了因为(因为我认为相同的代码)适用于VB6,但不适用于VB.NET。

我在VB6中的代码是:

Dim ProcID As Long
ProcId = Shell(uPath, WindowStyle)

.NET等价物是

Dim myProcess As Process = System.Diagnostics.Process.Start(uPath)

.NET代码抛出Win32 FileNotFoundException,而VB6代码完全正常。

两个版本的路径是

7z e "d:\myfile.7z" -o"d:\" 

VB6 CurDir()返回

C:\Program Files\7-Zip

VB.NET Directory.GetCurrentDirectory.ToString()返回

C:\Program Files\7-Zip

还有什么可能区别?

0 个答案:

没有答案