Simple example:
Using this component is very simple
1. Creating objects
2. Set some properties
3. Call the Geturl method
Here is the sample code for VBScript using Asphttp
Set httpobj = Server.CreateObject ("Asphttp.conn")
Httpobj.url = "Http://www.myfinancialpage.com/qrtresults.html"
strresult = Httpobj.geturl
Variable strresult now contains a string from http://www.myfinancialpage.com/qrtresults.html
Document results obtained by get
Example: getting GIF files
<%
REM This demo pulls a GIF image from www.microsoft.com
Server.ScriptTimeout = 240
Set httpobj = Server.CreateObject ("Asphttp.conn")
Httpobj.url = "Write.gif"
Httpobj.followredirects = False
Httpobj.requestmethod = "Get"
Httpobj.useragent = "mozilla/2.0" (compatible; MSIE 3.0B; Windows NT) "
Httpobj.savefileto = "C:write.gif"
Httpobj.geturl
Response.Write "%>
Instance: processing and displaying the URL-contained href
<body>
<%
Server.ScriptTimeout = 240
Set httpobj = Server.CreateObject ("Asphttp.conn")
Httpobj.url = "Http://www.genusa.com/asp/tools.html"
Httpobj.requestmethod = "Get"
Httpobj.useragent = "mozilla/2.0" (compatible; MSIE 3.0B; Windows NT) "
strresult = Httpobj.geturl
Response.Write "Varhrefarray = Httpobj.gethrefs
Inthrefarraylimit = UBound (varhrefarray)-1
For I = 0 to Inthrefarraylimit
Response.Write Varhrefarray (I) & "<br>" & VBCrLF
Next
%>
</body>
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