Some previously collected data---Use ASP to establish HTTP components

Source: Internet
Author: User
Building HTTP Components
Do-it-yourself, with plenty of clothing, here's how to build your own asphttp components.
Using the Winsock control, the following describes how to build a simple HTTP component.
Remember to select the Mswinsck.ocx control first
The following code is compiled in VB6.
The code is as follows:
Private WithEvents Objwinsock as Mswinsocklib.winsock
Private strURL as String
Private Struri as String
Private Strserver as String
Private Nport as Long
Private Strhead as String
Private Strdata as String
Private bconnected as Boolean
Public Function HttpGet (URL As String) as String
Set Objwinsock = New Mswinsocklib.winsock
strURL = URL
parseURL
Connect
SendRequest
Objwinsock.close
Strhead = Left (strdata, InStr (strdata, VbCrLf & VbCrLf))
Strdata = Right (Strdata, Len (strdata)-InStr (Strdata, VbCrLf & VbCrLf))
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.