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")


arrow
arrow
    全站熱搜

    天才R 發表在 痞客邦 留言(0) 人氣()