Results 1 to 15 of 15

Thread: Converting from Webbrowser to Inet!?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    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?

  2. #2
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    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.
    8 gigs/ram (hey why not)
    300 gig HD x2
    Windows XP 64

  4. #4
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    Re: Converting from Webbrowser to Inet!?

    well, if you can wait about 5 mins, i will post it

  5. #5
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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.
    Attached Files Attached Files

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    Re: Converting from Webbrowser to Inet!?

    Ok I am testing and will report back sooooon
    8 gigs/ram (hey why not)
    300 gig HD x2
    Windows XP 64

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    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?

  8. #8
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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?

  9. #9
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Converting from Webbrowser to Inet!?

    why not just use the HTML object library (without the Webbrowser)

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    Talking 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)

  11. #11
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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:
    1. WebBrowser1.Document.documentElement.innerHTML
    and then process what is returned

  12. #12

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2006
    Posts
    395

    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:
    1. WebBrowser1.Document.documentElement.innerHTML
    and then process what is returned

    I'm not using Webbrowser Control.
    8 gigs/ram (hey why not)
    300 gig HD x2
    Windows XP 64

  13. #13
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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.

  14. #14
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    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

  15. #15
    Addicted Member
    Join Date
    Jul 2006
    Location
    Adelaide, Australia
    Posts
    204

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width