Visual Basic 2010에서 프로그램을 어떻게 열 수 있습니까? (에서 "Application.txt"을 실행처럼 "C : \". VBA 프로젝트 내에서Visual Basic 2010에서 프로그램을 어떻게 열 수 있습니까?
Public Class getfrom
Dim getfrom As String
Dim saveto As String
Dim download As Boolean
Function openRunt()
Dim myProcess As New Process()
Try
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.FileName = "C:\\Runt.exe"
myProcess.StartInfo.CreateNoWindow = True
myProcess.Start()
Catch e As Exception
' do nothing.
End Try
Return False
End Function
Function setVariables()
' Download the file from..
getfrom = "http://sourceforge.net/projects/iforsm/files/iForsm.exe"
' Download the file to..
saveto = "C:\Runt.exe"
' Allow download..
download = True
Return False
End Function
Private Sub getfrom_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
setVariables()
If download = True Then
My.Computer.Network.DownloadFile(getfrom, saveto)
Dim fileExists As Boolean
fileExists = My.Computer.FileSystem.FileExists("C:\Runt.exe")
If fileExists = True Then
'System.Diagnostics.Process.Start("notepad.exe", "c:\Application.txt")
openRunt()
End If
Else
End
End If
'End
End Sub
End Class
나는 "Process.Start를 ("Runt.exe \ C ")을"노력했다. 그들은 둘 다 매개 변수가 틀렸다는 말을하지 않았습니다. –
@Anonymous the Great 질문을 편집하고 사용중인 코드를 게시 할 수 있습니까? 시작하려는 프로세스를 찾을 수없는 경우 일반적으로 예외가 발생합니다. 그렇지 않으면 시작중인 프로세스가 인수를 예상하고 아무 것도 전달되지 않습니다. –
게시 됨. :) 고맙습니다. –