Results 1 to 5 of 5

Thread: inet object

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    1

    Post

    Is there any way that I can make a http connection and download a html page from a url without using the inet object.

    I don't have a form to put the object on, as I am developing a ASP active x object, which doesn't have a form.

    Appreciate any help on this with VB6,

    thanks

  2. #2
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    Use Winsock.

    Send the follwing data to the http server (usually on port 80):

    GET http://www.thisserver.com/index.html


    followed by a vbCrLf.

    ------------------
    Tom Young, 14 Year Old
    [email protected]
    ICQ: 15743470 Add Me ICQ Me
    AIM: TomY10
    PERL, JavaScript and VB Programmer

  3. #3
    Lively Member
    Join Date
    Nov 1999
    Location
    Melbourne, Victoria, Australia
    Posts
    126

    Post

    Try this...

    Private Sub Command1_Click()
    'connect to server
    Winsock1.connect "www.vb-world.net", 80
    End Sub

    Private Sub Winsock1_Connect()
    'send http request (ask for the file)
    Winsock1.senddata "GET /index.html HTTP/1.0" & vbclrf & vbcrlf
    End Sub

    Private Sub Winsock1_DataArrival(bytes as long)
    'weve recieved a packet, keep track of it and add it to the text box
    Winsock1.getdata TempStr, vbString
    text1.text = text1.text & TempStr
    End Sub

    Private Sub Winsock1_Close()
    'its complete, the httpd server automatically closes the connection
    'when the file get is complete
    msgbox "Download complete."
    End Sub

    ------------------
    Regards,

    Paul Rivoli
    -------------------
    [email protected] http://users.bigpond.com/privoli


    [This message has been edited by privoli (edited 11-23-1999).]

  4. #4
    PowerPoster
    Join Date
    Jul 1999
    Posts
    5,923

    Post

    Unfortunately, privoli's suggestion requires you to have a form to put the winsock control on (if i'm not mistaken), so you need to use Winsock APIs i do believe. Don't ask me how though, I'm useless at APIs!!

    Someone called Mystiq who is a member of this BB is a wiz at Winsock API programming apparently, perhaps you should try contacting him.

    Regards,

    ------------------
    - Chris
    [email protected]

  5. #5
    Addicted Member
    Join Date
    Jan 1999
    Posts
    173

    Post

    Chris Eastwood has written a full FTP program using the Inet APIs: Check it out: http://www.codeguru.com/vb/

    ------------------
    "To the glory of God!"

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