J
jcrouse
Here is my code:
Dim sw As StreamWriter = File.CreateText(Application.StartupPath
& "\mameversion.bat")
sw.WriteLine(lblMameExePath.Text & " -help >""" &
Application.StartupPath & "\mameversion.txt""")
sw.Close()
Dim p As New System.Diagnostics.ProcessStartInfo
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = Application.StartupPath & "\mameversion.bat"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
If File.Exists(Application.StartupPath & "\mameversion.txt")
Then
Dim sr As StreamReader = New
StreamReader(Application.StartupPath & "\mameversion.txt")
strLine = sr.ReadLine()
sr.Close()
lblMameVersion.Text = Mid(strLine, 11, 4)
frm1.dblMameVer =
System.Convert.ToDouble(lblMameVersion.Text)
lblMameVersion.Refresh()
End If
What is happening is that I am creating the batch file, then executing the
batch file to create the text file. I then look inside the text file to get
a version number of the program. If I execute the code fast the version
number never gets written into the label control. If I step through it in
the debugger, it works fine. I think a run-time speed the version is yet to
be found when I try to write it to the label control. Could I be correct
here? If so, how do I put a momentary pause in the code?
Thanks,
John
Dim sw As StreamWriter = File.CreateText(Application.StartupPath
& "\mameversion.bat")
sw.WriteLine(lblMameExePath.Text & " -help >""" &
Application.StartupPath & "\mameversion.txt""")
sw.Close()
Dim p As New System.Diagnostics.ProcessStartInfo
p.WindowStyle = ProcessWindowStyle.Hidden
p.FileName = Application.StartupPath & "\mameversion.bat"
p.UseShellExecute = True
System.Diagnostics.Process.Start(p)
If File.Exists(Application.StartupPath & "\mameversion.txt")
Then
Dim sr As StreamReader = New
StreamReader(Application.StartupPath & "\mameversion.txt")
strLine = sr.ReadLine()
sr.Close()
lblMameVersion.Text = Mid(strLine, 11, 4)
frm1.dblMameVer =
System.Convert.ToDouble(lblMameVersion.Text)
lblMameVersion.Refresh()
End If
What is happening is that I am creating the batch file, then executing the
batch file to create the text file. I then look inside the text file to get
a version number of the program. If I execute the code fast the version
number never gets written into the label control. If I step through it in
the debugger, it works fine. I think a run-time speed the version is yet to
be found when I try to write it to the label control. Could I be correct
here? If so, how do I put a momentary pause in the code?
Thanks,
John