YES I WANTED TO REDIRECT THE PING COMMAND'S OUTPUT TO A TEXTBOX IN THE FORM.I WROTE THIS CODE BUT IT IS NOT WORKING.COULD U PLEASE HELP ME ON THIS
Visual Basic:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim p As New Process()
Dim ps As New ProcessStartInfo
p.StartInfo.FileName = "cmd.exe"
Dim str As String
str = "ping 10.21.19.1"
p.StartInfo.Arguments = str
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.Start()
'Console.WriteLine(p.StandardOutput.ReadToEnd)
TextBox2.AppendText(p.StandardOutput.ReadToEnd())
Last edited by a moderator: