Results 1 to 9 of 9

Thread: [RESOLVED] webcontrol..automated login..help?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    24

    Resolved [RESOLVED] webcontrol..automated login..help?

    i want to automaticaLLY LOGIN TO MY gmail a/c...i use code..(when document completes loading)....


    WebBrowser1.Document.All.GetElementsByName("Email")(0).InnerText = "username"
    WebBrowser1.Document.All.GetElementsByName("Passwd")(0).InnerText = "password"


    but it gives me some error....

    why cant i use this??
    can anyone give me the code required??


    thnking in advance
    Last edited by Hack; Apr 13th, 2006 at 11:39 AM. Reason: Added [RESOLVED] to thread title and green "resolved" checkmark

  2. #2
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    WebBrowser : Auto Login To GMail

    Welcome to the forums !

    Check the following code. I hope it will help.
    VB Code:
    1. Option Explicit
    2. Const GMAIL_URL = "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml"
    3. '============================================================
    4. Private Sub Form_Load()
    5.     WebBrowser1.Navigate GMAIL_URL
    6. End Sub
    7. '============================================================
    8. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    9.  
    10.     If (pDisp = WebBrowser1) Then 'Document finished loading 100%
    11.         If (URL = GMAIL_URL) Then 'We are in GMail homepage
    12.             With WebBrowser1.Document
    13.                 .getElementsByName("Email").Item(0).Value = "UserName"
    14.                 .getElementsByName("Passwd").Item(0).Value = "PassWord"
    15.                 .getElementsByName("null").Item(0).Click
    16.             End With
    17.         End If
    18.     End If
    19.  
    20. End Sub
    Last edited by iPrank; Apr 13th, 2006 at 01:36 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  3. #3
    PowerPoster Static's Avatar
    Join Date
    Oct 2000
    Location
    Rochester, NY
    Posts
    9,390

    Re: webcontrol..automated login..help?

    u dont need to use elementbyid in this case:

    VB Code:
    1. Option Explicit
    2. Const GMAIL_URL = "https://www.google.com/accounts/ServiceLogin?service=mail&passive=true&rm=false&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fui%3Dhtml"
    3. '============================================================
    4. Private Sub Form_Load()
    5.     WebBrowser1.Navigate GMAIL_URL
    6. End Sub
    7. '============================================================
    8. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    9.     If (pDisp Is WebBrowser1.Application) Then
    10.         If URL = GMAIL_URL Then
    11.             WebBrowser1.Document.All.email.Value = "TEST"
    12.             WebBrowser1.Document.All.passwd.Value = "TEST"
    13.             WebBrowser1.Document.All.Null.Click
    14.         End If
    15.     End If
    16. End Sub
    JPnyc rocks!! (Just ask him!)
    If u have your answer please go to the thread tools and click "Mark Thread Resolved"

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    24

    Re: webcontrol..automated login..help?

    still i m facing problem..i m using a standard exe project..is it ok???

    and first method is not working..second one worked for a bit...and now the page is not ven opening....

  5. #5
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: webcontrol..automated login..help?

    Both method is working fine here.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  6. #6

    Thread Starter
    Junior Member
    Join Date
    Apr 2006
    Posts
    24

    Re: webcontrol..automated login..help?

    thnx..i made a small mistake..its working now~~

  7. #7
    New Member
    Join Date
    Jun 2008
    Posts
    1

    Unhappy Re: WebBrowser : Auto Login To GMail

    I am getting an error msg. Webbrowser1 variable not definded could you please tell me how to defind webrowser1.




    you can also reply to my email Address [Edited by MartinLiss]

  8. #8
    Lively Member wiz....'s Avatar
    Join Date
    Nov 2008
    Location
    Asia, Earth, Solar System, Milky Way Galaxy, Near Andromeda Galaxy, Universe
    Posts
    78

    Re: [RESOLVED] webcontrol..automated login..help?

    Using the attachment you can LOGIN to Gmail from VB6......

    ENJOY..................


    [I forgot to add credit to iPrank for his excellent code to open G-mail]
    Attached Files Attached Files
    Last edited by wiz....; Jan 3rd, 2009 at 08:23 AM.
    PAIN n SUFFERING-Pain is Inevitable,,suffering is optional...........
    WORK EXPECTATION--U can do anything in this world if u don't look for credit.........

  9. #9
    New Member
    Join Date
    Mar 2011
    Posts
    5

    Re: [RESOLVED] webcontrol..automated login..help?

    Thanks dear i need this but if some one make this by Inet or winsock then please please post here. and i feel that is not possible to make by inet. some here is any one who makes ??????????? please must reply. i request to all VB6 experts. thanks
    your early response will be highly appreciated for me.

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