Converting from Webbrowser to Inet!?
At this point im an expert at Webbrowser1 and HTML Object Library (har har)
I can post to my websites forms using it etc
I would like to know how I could do this with INET, I think it would make things a lot faster and less.... CLICKY hahah
Can someone provide me with an example of posting a username and password to a form and submitting it as well?
Assuming the input names are USERNAME and PASSWORD?
Re: Converting from Webbrowser to Inet!?
do you mean so you could log into say, vbforums by entering a username and password into a standard VB textbox in a standard VBEXE and pressing a command button?
If so, i can give you some source code to do that with winsock, however you will have to wait a couple of hours cause i gotta go out.
Reply or PM me if that is what you are after.
Re: Converting from Webbrowser to Inet!?
Quote:
Originally Posted by Macka007
do you mean so you could log into say, vbforums by entering a username and password into a standard VB textbox in a standard VBEXE and pressing a command button?
If so, i can give you some source code to do that with winsock, however you will have to wait a couple of hours cause i gotta go out.
Reply or PM me if that is what you are after.
Yes, that is exactly what is needed.
Re: Converting from Webbrowser to Inet!?
well, if you can wait about 5 mins, i will post it
1 Attachment(s)
Re: Converting from Webbrowser to Inet!?
Ok, this code is based on a web feedback form (which i included in the zip file)
To make it work with other forms you will need to change the headers. To use it with this site you will need to add an MD5 Hashing algorithm as vBulletin hashes usernames and passwords before sending them across the net.
Re: Converting from Webbrowser to Inet!?
Ok I am testing and will report back sooooon :D
Re: Converting from Webbrowser to Inet!?
Ok I can figure this out.
One more question though -
What if the form I'm posting to doesn't have a name?
In Webbrowser I could use the HTML object library and do
if INP.InnerText = "this"
then INP.Value = "this"
Is there any way to make it work without the form name?
Re: Converting from Webbrowser to Inet!?
well, in the example i gave you the form didnt have a name.
do you have the HTML code for this form?
Re: Converting from Webbrowser to Inet!?
why not just use the HTML object library (without the Webbrowser)
Re: Converting from Webbrowser to Inet!?
Oh wow I didn't know that was possible.
Can I get an example of joining the two? (winsck and HTML object library)
Re: Converting from Webbrowser to Inet!?
Its up to bushmobile for examples for the HTML Object Library, i always use the Webbrowser control and then extract the HTML using
vb Code:
WebBrowser1.Document.documentElement.innerHTML
and then process what is returned
Re: Converting from Webbrowser to Inet!?
Quote:
Originally Posted by Macka007
Its up to bushmobile for examples for the HTML Object Library, i always use the Webbrowser control and then extract the HTML using
vb Code:
WebBrowser1.Document.documentElement.innerHTML
and then process what is returned
I'm not using Webbrowser Control.
Re: Converting from Webbrowser to Inet!?
so your method requires the form to have a name? that could be a problem... you will either have to find a way to get around that or use bushmobile's or my method or another method if you can find it.
Re: Converting from Webbrowser to Inet!?
Quote:
Originally Posted by erbio
Oh wow I didn't know that was possible.
Can I get an example of joining the two? (winsck and HTML object library)
well i don't know anything about winsock - but i'm not sure why you'd need it.
presumably you already know how to manipulate the DOM to do what you want - so you just need to create the Document:
Code:
Private Sub Command1_Click()
Dim tHTML As HTMLDocument, HTML As HTMLDocument
Set tHTML = New HTMLDocument
Set HTML = tHTML.createDocumentFromUrl("http://www.google.com", vbNullString)
Do Until HTML.readyState = "complete"
DoEvents
Loop
' Now do your DOM stuff on the HTML object
End Sub
Re: Converting from Webbrowser to Inet!?
what is DOM?
oh, and bushmobile, not sure exactly what you know about winsock, although you did say "nothing"... basically it allows you to make a TCP/IP or UDP connection on any available port to any IP address with a server running (also allows you to make servers)
so the idea behind using winsock here is to emulate the browser by connecting to the webserver, and sending it HTTP headers that contain the relevant data.