我的可执行文件和工程文件在同一目录下。。An unhandled exception of type 'System.NullReferenceException' occurred in WindowsApplication3.exeAdditional information: Object reference not set to an instance of an object.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pInfo As PROCESS_INFORMATION
Dim sInfo As STARTUPINFO
Dim sNull As String
Dim lSuccess As Long
Dim lRetValue As Long
'Dim file As String sInfo.cb = Len(sInfo)
lSuccess = CreateProcess(sNull, _
"HAIMIN.EXE", _
0&, _
0&, _
1&, _
NORMAL_PRIORITY_CLASS, _
0&, _
sNull, _
sInfo, _
pInfo)
'CreateProcess(sNull, "haimin.exe", 0, 0, 0, NORMAL_PRIORITY_CLASS, 0, sNull, sInfo, pInfo) lRetValue = TerminateProcess(pInfo.hProcess, 0&)
lRetValue = CloseHandle(pInfo.hThread)
lRetValue = CloseHandle(pInfo.hProcess) End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim pInfo As PROCESS_INFORMATION
Dim sInfo As STARTUPINFO
Dim sNull As String
Dim lSuccess As Long
Dim lRetValue As Long
'Dim file As String sInfo.cb = Len(sInfo)
lSuccess = CreateProcess(sNull, _
"HAIMIN.EXE", _
0&, _
0&, _
1&, _
NORMAL_PRIORITY_CLASS, _
0&, _
sNull, _
sInfo, _
pInfo)
'CreateProcess(sNull, "haimin.exe", 0, 0, 0, NORMAL_PRIORITY_CLASS, 0, sNull, sInfo, pInfo) lRetValue = TerminateProcess(pInfo.hProcess, 0&)
lRetValue = CloseHandle(pInfo.hThread)
lRetValue = CloseHandle(pInfo.hProcess) End Sub
我用是VB。NET 实在不行啊。。
怎么搞捏。。弄了一下午了。。