I am not sure that even setting the username/password values is
working correctly, because if I step through the code, and manually
enter a value in the username field, then have the code below update
that to the correct user name, then click in the edit box, the
previous manual data returns... Strange...
Any one have any ideas how to properly submit this form so I can
authenticate?
Thanks....
Jason
Dim objIE As New SHDocVw.InternetExplorer 'Microsoft Internet
Controls
Dim objDOM As HTMLDocument 'Micosoft HTML Object Library
Dim txtField As HTMLInputTextElement
Dim btnLogin As HTMLButtonElement
objIE.Visible = True
objIE.Navigate2 "http://agencyfuel.zywave.com"
Do While objIE.ReadyState <> READYSTATE_COMPLETE
DoEvents
Loop
Set objDOM = objIE.Document
Set txtField = objDOM.all
("dnn_ctr616_View_ctl01_UsernameTextBox_text")
txtField.Value = "MyUserName"
Set txtField = objDOM.all
("dnn_ctr616_View_ctl01_PasswordTextBox_text")
txtField.Value = "MySecretPassword"
Set btnLogin = objDOM.all("dnn_ctr616_View_ctl01_LoginButton")
btnLogin.click
'objDOM.forms(0).submit
What Development Environment are you using. An ASP language would not use
the webbrowser control to submit the form post.
Regards.
"Jason C. Lamb" <jason...@gmail.com> wrote in message
news:6754ab8a-3c94-4df6...@m33g2000vbi.googlegroups.com...
--
Microsoft MVP - ASP/ASP.NET - 2004-2007
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
If you add a WebBrowser control to a form, instead of declaring it, you'll
be able to see the effects of your code.
Also, why are you polling readystate in a tight loop, process the
DocumentComplete event instead.
-MM
On Dec 12 2009, 1:07 pm, "rob^_^" <iecustomi...@hotmail.com> wrote:
> objIE.Navigate2
> "http://agencyfuel.zywave.com?dnn_ctr616_View_ctl01_UsernameTextBox_te...",,
Thanks,
On Dec 12 2009, 1:34 pm, "Bob Barrows" <reb01...@NOyahoo.SPAMcom>
wrote:
I show the browser... IE.Visible=True, so I can see what is happening
when I execute the click method of the submit button.
Once I get some working code I can move to event/state processing.
Thanks,
Jason