Visual Basic 2008 Web Auto Fill

Microsoft Visual studio 2008 professiona...
March 10, 2010 at 18:24:23
Specs: Windows XP
I am new to visual basic 2008 and am trying to navigate to a web site and automatically enter my username and password from within a visual basic program. Then I want to navigate to another page and fill data in various fields on the page.

See More: Visual Basic 2008 Web Auto Fill

March 10, 2010 at 19:25:54
sendkeys (always remember to put TRUE after the string):
shell "iexplore test"
'sleep 60 seconds for page to load
sleep 60000
on error goto errmsg
Appactivate "Test - microsoft internet explorer"
on error goto 0
sendkeys "{tab}",true
sendkeys "myusername",true
sleep 100
sendkeys "{tab}",true
sleep 100
sendkeys "mypasswod",true
sleep 100
'car.ret to submit the form
sendkeys "~",true

consult your vb "help" to see how to use "shell", "appactivate", and "sendkeys" and maybe "sleep"

also might help to post what ya got so far. No clue where you're starting from progress-wise.

Report •

March 10, 2010 at 21:05:05
Good lord, avoid SendKeys like a plague. Especially since you can interact with IE though its COM interface.

Report •

March 10, 2010 at 21:41:21
I am ignorant of this interface, i'll goog it...
I've been using sendkeys without problems though. What are the problems it poses?

Report •

Related Solutions

March 14, 2010 at 05:48:33
nbrane: What are the problems it poses?
Usability/Multitasking: Since SendKeys sends messages to the active application, the user cannot actually use his computer while your script/program is running.

Predictability: All versions of SendKeys are prone to timing issues. Partly because it doesn't force the programmer to do any validation, partly because the .NET variant can switch implementations on you as it deems necessary.

Reliability: Older versions of SendKeys (VB6 and down, probably VBS and VBA as well) get blocked by UAC. This means your program/script can't be run reliably on Vista or Win7. If you use VB.NET's SendWait, it's behavior will break, again, dependent on the state of UAC.

Readability: You're sending a series of key presses, so it can be hard to go back and see what the original intent was when you wrote the script/program.

nbrane: I am ignorant of this interface

Report •

Ask Question