Advertisement
hungvb

Send VB

Dec 18th, 2021
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.04 KB | None
  1.  Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  2.         WebBrowser1.Navigate("localhost/send-data.php")
  3.     End Sub
  4.  
  5.     Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
  6.  
  7.         Dim Page As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("input")
  8.         For Each Element As HtmlElement In Page
  9.             If Element.GetAttribute("id").Contains("txtName") Then
  10.                 Dim oTName As HtmlElement = Element
  11.                 oTName.InnerText = txtName.Text
  12.             End If
  13.  
  14.             If Element.GetAttribute("id").Contains("txtProfession") Then
  15.                 Dim oTProfession As HtmlElement = Element
  16.                 oTProfession.InnerText = txtProfession.Text
  17.             End If
  18.  
  19.             If Element.GetAttribute("id").Contains("btnSubmit") Then
  20.                 Dim oBtn As HtmlElement = Element
  21.                 oBtn.InvokeMember("click")
  22.             End If
  23.         Next
  24.     End Sub
  25.  
  26. End Class
Advertisement
RAW Paste Data Copied
Advertisement