Results 1 to 2 of 2

Thread: [RESOLVED] [2005] Webbrowser - Find form

  1. #1

    Thread Starter
    Lively Member smart_phil_dude1's Avatar
    Join Date
    Jun 2005
    Location
    Behind You!
    Posts
    125

    Resolved [RESOLVED] [2005] Webbrowser - Find form

    I've seen this before so i know it's possible.

    I have a webbrowser and once it's navigated to a certain page, i want it to find a certain textbox (username), type something in it, find the password textbox, type something in there and then click on submit.

    what kind of code would i use for this sort of thing?

    Thanks,
    Phil
    Please Help Us Save Ana or donate now by going to Oneana.com

    Visit my Website at http://www.therealfantasy.com

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: [2005] Webbrowser - Find form

    if the page is in frames it probably won't work, but if its not, then you can use this code.
    VB Code:
    1. Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted
    2.         WebBrowser1.Document.All("txtUser").SetAttribute("value", "myusername")
    3.         WebBrowser1.Document.All("txtPassword").SetAttribute("value", "mypassword")
    4.         WebBrowser1.Document.All("btnSubmit").InvokeMember("click")
    5.     End Sub
    Last edited by kleinma; Jan 24th, 2007 at 10:26 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