views:

394

answers:

2

Hi,

I need to programmtically key in the username, password for a website using Webbrowser control in Visual Basic 6.0 application (please note it is not .Net application) and also click on Login button.

Also I am not trying to hack or spam. The requirement is part of interfacing that I am trying to create between multiple applications.

Please let me know how to go about this.

Thanks

A: 

I think you should use some HTTP request and store the returned cookie (there probably will be one). Observe the login process on the page if it's GET or POST method, and if it uses a cookie. I don't think you need webbrowser control for this.

Tamás Szelei
+1  A: 

You can use the Document property of the WebBrowser control to interact with the HTML page. In your case, it would depend on the structure of the web site, but you should be able to do something like this (untested)

With webBrowser.Document.forms(1)
    .getElementByName("username").value = "username"
    .getElementByName("password").value = "password"
    .submit()
End With
SLaks

related questions