[Request] Filling In Webboxes with Information Through Visual Basic

Posts 15 of 5 · Page 1 of 1
[Request] Filling In Webboxes with Information Through Visual Basic
I want to be able to enter information in a textbox in my program and have it fill in the infomation a web application. please help Thank you
Make a
Code:
sendkeys.send("{KEYS}")
should be the easy one.... Or make your own webbrower with auto fill!
I Found Out How
I found out how so Just Incase anyone wants to know....I Used this Code

Note : When you See ("Green") You Replace , Such As I would replace ID with my variable

Code:
Public Class Form1

    Inherits System.Windows.Forms.Form
    Dim asd

    Private Function GetBtnByValue(ByVal value As String) As HtmlElement
        For Each d As HtmlElement In Webbrowser1.Document.GetElementsByTagName("input")
            'If (d.GetAttribute("type").ToLower = asd.Text Or d.GetAttribute("type").ToLower = "submit") Then
            If (d.GetAttribute("type").ToLower = "submit") Then
                If (d.GetAttribute("value") = value) Then
                    Return d
                    Exit For
                End If
            End If
        Next
    End Function

    

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("ID").SetAttribute("value", TextBox1.Text())
        

        'GetBtnByValue("What the Button Says").InvokeMember("Click")



    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://website.com") 'the target
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
         'GetBtnByValue("What the Button Says").InvokeMember("Click")
    End Sub
End Class
Quote Originally Posted by CoderNever View Post
I found out how so Just Incase anyone wants to know....I Used this Code

Note : When you See ("Green") You Replace , Such As I would replace ID with my variable

Code:
Public Class Form1

    Inherits System.Windows.Forms.Form
    Dim asd

    Private Function GetBtnByValue(ByVal value As String) As HtmlElement
        For Each d As HtmlElement In Webbrowser1.Document.GetElementsByTagName("input")
            'If (d.GetAttribute("type").ToLower = asd.Text Or d.GetAttribute("type").ToLower = "submit") Then
            If (d.GetAttribute("type").ToLower = "submit") Then
                If (d.GetAttribute("value") = value) Then
                    Return d
                    Exit For
                End If
            End If
        Next
    End Function

    

    Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        WebBrowser1.Document.GetElementById("ID").SetAttribute("value", TextBox1.Text())
        

        'GetBtnByValue("What the Button Says").InvokeMember("Click")



    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        WebBrowser1.Navigate("http://website.com") 'the target
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
         'GetBtnByValue("What the Button Says").InvokeMember("Click")
    End Sub
End Class
dam noob give me credit that's what i posted it for
http://www.mpgh.net/forum/33-visual-...utomating.html
Thanks brah i'll keep dis in mind for later.
Posts 15 of 5 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?