Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Execute Submit button in html page from VB6.0


Execute Submit button in html page from VB6.0

Author
Message
cedrajendran
cedrajendran
Forum God
Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)Forum God (696 reputation)

Group: Forum Members
Posts: 2, Visits: 10
Hello friends,

I have a command button in VB6.0. and also i have a html page with login controls(User name, Password, Submit button) in my local drive(c:\). What i want is, When i click the Button from VB, it should pass username and Password to html page and execute that submit button automatically. How can i achieve this? Please provide some sample code.



Thanks in advance.



Regards,



Rajendran.


Thanks & Regards,

Rajendran.M
Joey
Joey
Forum God
Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)Forum God (16K reputation)

Group: Forum Members
Posts: 72, Visits: 46
Add a WebBrowser control to your project.

Load the page with:

WebBrowser1.Navigate "C:\page.html", 14



In the DocumentComplete event, use the

Document Object Model (DOM) to access the

page. For instance, if your button has an ID

like,



INPUT TYPE="button" ID="But1">

then you can click it using:

WB.document.But1.click.

In the same way, you can programmatically

enter text into the name and password fields.



You'll need to look up in the docs if you don't

know about how to use the DOM. That's a big

topic, and it's quirky. You may even need to test

your code in different IE versions. Microsoft breaks

compatibility from one version to the next. In fact,

there's a long story about how to deal with that,

specifically. But it's too much to cover in a newsgroup.

You need to learn about scripting the browser.

(Using DOM is basically webpage scripting, but it can

be done in VB with the WB control.)



To find out what methods are available, open

MSDN and look up "all" in the index. Then bookmark

that topic and you'll have quick access to the help

for each type of HTML element.



Edited
2/25/2011 by Joey
GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search