Dim proc2 As New Process
' proc2 = Process.Start(VB6.GetPath & "\\cTestExitCodeEXE.exe", "EnterTestMode")
'MessageBox.Show(proc2.ProcessName)
'proc2.WaitForExit()
'Thread.Sleep(2000)
proc2.StartInfo.UseShellExecute = False
proc2.StartInfo.RedirectStandardOutput = True
proc2.StartInfo.FileName = VB6.GetPath & "\\cTestExitCodeEXE.exe"
proc2.StartInfo.Arguments = "EnterTestMode"
proc2.Start()
proc2.WaitForExit()
Thread.Sleep(2000)
Dim strResult As String
strResult = proc2.StandardOutput.ReadToEnd()
MessageBox.Show(strResult, "returnValue")
strResult = proc2.StandardOutput.ReadLine()
MessageBox.Show(strResult, "returnValue2")
Dim intCode As Integer
intCode = proc2.ExitCode
'MessageBox.Show(intCode.ToString, "msg")
- Oct 27 Thu 2011 18:18
[vb.net] SampleCode : Process.Start & StartInfo & StandardOutput
全站熱搜
留言列表