這裏是我的問題是,我使用form1(我)與webbrowser顯示自定義錯誤,我檢查一個INI文件,看看我需要什麼屏幕和我做了一個navagate.webbrowser1和網址,然後用網頁瀏覽器顯示整個表單。當我運行這個,我得到一個黑色的屏幕或白色的屏幕,或沒有在前面的表單設置我稱之爲在這個過程中在後檯安裝打印機的程序。當使用form.show時,使用webbrowser最小化的窗體VB網
我希望窗體在前面,而另一個程序運行和fisnishes,這是我的程序的結束,這有一些動畫在網頁上顯示用戶該程序仍在運行,但我可以不會讓表格出現。
這裏是我的代碼:
'*********************************************************************************************
'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
只有到目前爲止,您可以通過試驗和錯誤編程獲得。你用這段代碼紮實地打破了牆壁,每一行代碼都以某種方式被打破。拿起一本書或參加學校,以提前。擺脫循環。 – 2013-02-20 18:53:37