Results 1 to 40 of 531

Thread: Manipulate/Change/Form Fill data in webpages using the Webbrowser control

Threaded View

  1. #11
    New Member
    Join Date
    Apr 2007
    Posts
    10

    Re: Manipulate/Change/Form Fill data in webpages using the Webbrowser control

    kleinma:
    I have tried your example and it seems to work in VB2008 but if I start from scratch and just copy in your code for a button to my project it doesn't work it seems to have something to do with the windows form genertated code. The error I get is on the 3 webBrowser.Document.forms.item(, 0) lines and the error is overload resolution failed because no accessible 'Item' accepts this number of arguments. How do I make it generate the windows form code for my own project?
    Also I tried using a URL of https://www.harrahs.com/MyHarrahs.do with:
    webBrowser.Document.forms.item(, 0).elements("accountId").value = "15701390709"
    webBrowser.Document.forms.item(, 0).elements("pin").value = "1234"
    webBrowser.Document.forms.item(, 0).submit()
    but it comes back with a totally blank page instead of an error page, the ID and password are fake, or the correct status page with correct login info.

    My code that generates the error is:
    Imports System.Web
    Public Class Form1
    Inherits System.Windows.Forms.Form
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.Navigate("https://www.harrahs.com/MyHarrahs.do")
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    WebBrowser1.Document.Forms.Item(, 0).elements("accountId").value = "1234567"
    WebBrowser1.Document.Forms.Item(, 0).elements("pin").value = "1234"
    WebBrowser1.Document.Forms.Item(, 0).submit()
    End Sub

    End Class
    Last edited by ed08724; Feb 12th, 2008 at 05:30 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width