我有一個關於在VB .NET項目中運行exe文件的問題。從VB.NET項目運行VB類型的exe文件
我以前讀的文章 http://www.dreamincode.net/forums/topic/244460-how-to-run-a-exe-file-from-inside-a-vs2010-project/
運行從VB.NET項目內的exe文件。
我用
的Process.Start( 「My.Resources \ MyProgram.exe」) 和 System.Diagnostics.Process.Start(My.Computer.FileSystem.SpecialDirectories.Desktop &「\屏幕
然而.EXE「)
運行exe文件,它沒有任何發生。因此,我認爲這條道路是錯誤的運行exe文件
這裏是我做了運行exe文件
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If My.Computer.FileSystem.FileExists((My.Computer.FileSystem.SpecialDirectories.Desktop & "\screen.exe")) Then
MsgBox("yes")
Process.Start((My.Computer.FileSystem.SpecialDirectories.Desktop & "\screen.exe"))
Else
MsgBox("np")
End If
我手動點擊exe文件,它正常運行。 此外,我使用if語句來確定是否存在文件
它返回true表示存在一個exe文件。
但是,當我在Visual Studio 2012(VB.NET)項目中運行。 沒有錯誤,它似乎沒有運行文件。
,我真的不知道爲什麼發生這種情況
有誰知道爲什麼出現這種情況?謝謝
什麼是調用Process.S的返回值酸? –
我的示例exe文件應該截取屏幕截圖。當我雙擊exe文件。它正在工作。但是,當我運行我的VB.NET項目來運行exe文件。只是沒有發生... –
我不相信exe文件返回它。 exe文件只是截圖 –