VB.net 如何逐行获取CMD命令行的逐行输出

VB.net 调用命令行,无法获取逐行的输出
            Dim  P = New Process
            With P.StartInfo
                .FileName = "cmd.exe"
                .Arguments = "/c " & strCMD
                .UseShellExecute = False
                .RedirectStandardInput = True
                .RedirectStandardOutput = True
                .RedirectStandardError = True
                .CreateNoWindow = True
            End With
            P.Start()
        End If
        Do
            result = P.StandardOutput.ReadLine
        Loop While Not P.HasExited

img

Do
    result = P.StandardOutput.ReadLine
    TextBox1.Text &= result & vbCrLf
    Application.DoEvents()
Loop While Not P.HasExited