[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.vb.general.discussion

Execute Submit button in html page from VB6.0

jb

2/25/2011 6:25:00 PM

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
2 Answers

Mayayana

2/25/2011 8:19:00 PM

0

* 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"></INPUT>
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.


|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


(nobody)

2/25/2011 8:44:00 PM

0

"jb" <trader_boss7@yahoo.com> wrote in message
news:3b91b4ea-5db2-4b5c-866a-8aa232529749@o14g2000prb.googlegroups.com...
>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.

Besides what Mayayana suggested, you can loop through all forms, and submit
the one that matches the name you want. See this link and look for
".submit":

http://groups.google.com/group/comp.lang.basic.visual.misc/msg/9beb93...