[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
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
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
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....
Re: webcontrol..automated login..help?
Both method is working fine here. :confused:
Re: webcontrol..automated login..help?
thnx..i made a small mistake..its working now~~
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]
1 Attachment(s)
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]
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.