|
-
Apr 12th, 2006, 10:06 PM
#1
Thread Starter
Junior Member
[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
-
Apr 13th, 2006, 01:30 AM
#2
WebBrowser : Auto Login To GMail
Welcome to the forums ! 
Check the following code. I hope it will help.
VB Code:
Option Explicit
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"
'============================================================
Private Sub Form_Load()
WebBrowser1.Navigate GMAIL_URL
End Sub
'============================================================
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp = WebBrowser1) Then 'Document finished loading 100%
If (URL = GMAIL_URL) Then 'We are in GMail homepage
With WebBrowser1.Document
.getElementsByName("Email").Item(0).Value = "UserName"
.getElementsByName("Passwd").Item(0).Value = "PassWord"
.getElementsByName("null").Item(0).Click
End With
End If
End If
End Sub
Last edited by iPrank; Apr 13th, 2006 at 01:36 AM.
-
Apr 13th, 2006, 07:49 AM
#3
Re: webcontrol..automated login..help?
u dont need to use elementbyid in this case:
VB Code:
Option Explicit
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"
'============================================================
Private Sub Form_Load()
WebBrowser1.Navigate GMAIL_URL
End Sub
'============================================================
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Application) Then
If URL = GMAIL_URL Then
WebBrowser1.Document.All.email.Value = "TEST"
WebBrowser1.Document.All.passwd.Value = "TEST"
WebBrowser1.Document.All.Null.Click
End If
End If
End Sub
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 13th, 2006, 10:40 AM
#4
Thread Starter
Junior Member
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....
-
Apr 13th, 2006, 10:44 AM
#5
Re: webcontrol..automated login..help?
Both method is working fine here.
-
Apr 13th, 2006, 11:19 AM
#6
Thread Starter
Junior Member
Re: webcontrol..automated login..help?
thnx..i made a small mistake..its working now~~
-
Jun 26th, 2008, 11:32 PM
#7
New Member
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]
-
Jan 3rd, 2009, 08:19 AM
#8
Lively Member
-
Mar 19th, 2011, 06:37 AM
#9
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|