这是我的问题,我使用 form1 (me) 和 webbrowser 来显示自定义错误,我检查 INI 文件以查看我需要的屏幕,然后我执行 navagate.webbrowser1 和网址,然后显示表格,网络浏览器占据整个表格。当我运行它时,我得到一个黑屏或一个白屏,或者前面没有设置表单我调用一个程序,在这个过程中在后台安装打印机。
我希望表单在前面,而其他程序运行并完成,这是我的程序的结尾,这在网页上有一些动画,向用户显示程序仍在运行,但我无法获得表格显示。
这是我的代码:
'*********************************************************************************************
'this set the correct screen for Exit
'*********************************************************************************************
RBoot = reboot1
If RBoot = "True" Then
closeweb = "https://xxxxxxxxxxxxxxx/_report/enrollment.asp?page=completesuccess"
WebBrowser1.Navigate("https://XXXXXXXXXXXX/_report/enrollment.asp?page=completesuccess")
var1 = 0
Form9.Hide()
Form10.Hide()
Do Until var1 = 5
Me.Show()
Me.Refresh()
Thread.Sleep(400)
Loop
ElseIf RBoot = "False" Then
closeweb = "https://XXXXXXXXXXXXXX/_report/enrollment.asp?page=completenoreboot&name=" & computername
WebBrowser1.Navigate("https://XXXXXXXXXXXXXXX/_report/enrollment.asp?page=completenoreboot&name=" & computername)
var1 = 0
Form9.Hide()
Form10.Hide()
Do Until var1 = 5
Me.Show()
Me.Refresh()
Thread.Sleep(400)
Loop
End If
'*********************************************************************************************
' this runs the Printer Installer
'*********************************************************************************************
Dim Compini As String = My.Computer.FileSystem.ReadAllText("C:\temp\computerinfo.ini")
logg = "Computer Info INI:" & vbCrLf & Compini
Call logging()
If Compini.Contains("Printer") Then
If My.Computer.FileSystem.FileExists(current_DIR & "\ Printer Installer\Printerinstaller.exe") Then
Me.Show()
Dim printerinstall As New Process
printerinstall.StartInfo.FileName = current_DIR & "\Printer Installer\PrinterInstaller.exe"
printerinstall.StartInfo.Arguments = " -D C"
printerinstall.StartInfo.WindowStyle = ProcessWindowStyle.Hidden
printerinstall.Start()
Try
While printerinstall.HasExited = False
Thread.Sleep(200)
Me.Show()
End While
Catch ex As InvalidOperationException
End Try
logg = "Ran " & current_DIR & "\Printer Installer\PrinterInstaller.exe"
Call logging()
Else
logg = "Can't Find " & current_DIR & "\Printer Installer\PrinterInstaller.exe"
Call logging()
WebBrowser1.Navigate("https://XXXXXXXXXXXXXXXX/_report/enrollment.asp?page=printerinstallernotfound&name=" & computername)
Form9.Hide()
Form10.Hide()
Me.Show()
Exit Sub
End If
Else
logg = "No Printer Selected and Printer Installer didn't run"
Call logging()
End If