Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

automated login help on a web page using sendkeys or appactivate on windows vista

Hi i have been trying to write a little app that will sit in taskbar and open a browser control and login to a website, its part of a new authentication system our central network group has done.
basically from what im seeing sendkeys no  longer works in vista which makes things more difficult :( as im not overly familiar with api calls etc so if anyone can help itd be greatly appreciated.

basically i have a form, Form1 it has a webrowser control which loads our auth page there are 2 textboxes on the page "username" and "password which i need to enter data in and click the submit button.

if anyone can assist or point me in the right direction itd be greatly appreciated
0
dadd0012
Asked:
dadd0012
  • 2
  • 2
1 Solution
 
RimvisCommented:
How about this:
    WebBrowser1.Document.GetElementByID("username").InnerText = "rgurskis"
    WebBrowser1.Document.GetElementByID("password").InnerText = "rimrimrim"
    WebBrowser1.Document.GetElementByID("submit_button_name_goes_here").Click
0
 
dadd0012Author Commented:
OMG i cant believe it wass that simple lol i was looking at api calls etc etc the only other prob i now have is that it opens a heartbeat page in a new window is there a way to force that to either open in same or webbrowser2 ?
0
 
RimvisCommented:
In general, when handling new windows, you should create new form with a WebBrowser control.
Take a look here:
How To Use the WebBrowser Control NewWindow2 Event
http://support.microsoft.com/kb/184876


But if you still want to display pop-up in same control or on another control in same form, you could use this approach:
How To Cause Navigation to Occur in Same WebBrowser Window
http://support.microsoft.com/kb/185538

Note that this SHOULD have worked with IE versions up to 5.5. But it still works with IE7. Not sure if SHDocVwCtl.WebBrowser_V1 class will be supported in future versions.

I would use first method with new forms.

0
 
dadd0012Author Commented:
thanks for the help that worked great i went with the 2nd option but it works great thanks again you have made my day :)
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now