Crée un webbrowser dans un thread d'arrière-plan, puis est censé naviguer vers une URL et retourner un htmldocument, mais la navigation échoue pour une raison quelconque, une idée pourquoi?Pourquoi ce contrôle Webbrowser en arrière-plan ne parvient-il pas à naviguer?
REMARQUE: cela fait partie d'une classe où vous voyez ME.url ou moi. ... me.isrunning = booléen false par défaut me.url = uri de l'emplacement pour naviguer à
Public Function GetDOC(ByVal url As Uri) As HtmlDocument
If Me.IsRunning Then
Throw New Exception("Object Currently In use")
End If
htmdoc = Nothing
Dim cp As New Threading.Thread(AddressOf thrdowo)
cp.SetApartmentState(Threading.ApartmentState.STA)
cp.Start()
run = True
While run
End While
Return htmdoc
End Function
Private Sub thrdowo()
Dim cbl As New WebBrowser
'cbl.Url = Me.URL
cbl.Navigate("about:blank")
cbl.Navigate(Me.URL)
While cbl.IsBusy
End While
htmdoc = cbl.Document
run = False
End Sub