-1

How to First Run File seconds stream file in text box via if and else

    If Process.Start("test.bat") Then
        Dim address As String = "id.txt"
        Dim client As WebClient = New WebClient()
        Dim reader As StreamReader = New StreamReader(client.OpenRead(address))
        TextBox1.Text = reader.ReadToEnd
    End If

Note: text file generated via batch file.

1 Answers1

0
Try
    Dim proc = Process.Start("test.bat")
    proc.WaitForExit()
    Using client As New WebClient()
        TextBox1.Text = client.DownloadString(File.ReadAllText("id.txt"))
    End Using
Catch
End Try
Joel Coehoorn
  • 399,467
  • 113
  • 570
  • 794