cs_Morinaux
Messages postés34Date d'inscriptionmercredi 19 novembre 2003StatutMembreDernière intervention16 mai 2009
-
25 sept. 2008 à 20:40
cs_Morinaux
Messages postés34Date d'inscriptionmercredi 19 novembre 2003StatutMembreDernière intervention16 mai 2009
-
25 sept. 2008 à 21:14
Bonsoir, alors voilà en fait en vb6 je faisais de la manière suivante pour remplir un textbox d'une page web :
Option Explicit
Dim MyForm As HTMLFormElement
Private Sub Form_Load()
WebBrowser.Navigate "http://www.urldelapageweb.fr/"
Do
DoEvents
Loop Until Not WebBrowser.Busy
Set MyForm = RemplirTextArea(WebBrowser.Document, "idduchamp", "jeveuxmarquerça)
MyForm.submit
End Sub
Public Function RemplirTextArea(ByRef doc As HTMLDocument, ByVal InputName As String, ByVal Value As String) As HTMLFormElement
On Error Resume Next
Dim d As HTMLObjectElement
Dim minput As HTMLTextAreaElement
For Each d In doc.All
DoEvents
For Each minput In d.All
DoEvents
If minput.tagName = "INPUT" Then
If minput.Name = InputName Then
minput.Value = Value
Set RemplirTextArea = minput.Form
Exit Function
End If
End If
Next
Next
End Function
Mais en vbnet c'est différent, pour le webbrowser j'ai trouvé, pour l'équilvalent du DoEvents j'ai aussi trouvé mais il reste encore le HTMLFormDocument que je sait pas par quoi le remplacer.