ASP generates an HTM file. Use XMLHTTP to obtain the source code. Use the steam stream to open and save the source code.

Source: Internet
Author: User
<%
Id = request. querystring ("ID ")
Dim strurl, item_classid, ID, filename, filepath, do_url, html_temp
Html_temp = "<ul>"
'For I = 1 to 3
Html_temp = html_temp & "<li>"
Item_classid = ID
Filename = "\ 2222 \ 1111" & item_classid & ". htm"
Filepath = server. mappath ("\") & filename
Html_temp = html_temp & filepath & "</LI>"
Do_url = "http ://"
Do_url = do_url & request. servervariables ("SERVER_NAME") & "/1111.asp"
Do_url = do_url &"? Id = "& item_classid
Strurl = do_url
Dim objxmlhttp
Set objxmlhttp = server. Createobject ("Microsoft. XMLHTTP ")
Objxmlhttp. Open "get", strurl, false
Objxmlhttp. Send ()
Dim binfiledata
Binfiledata = objxmlhttp. responsebody
Dim objadostream
Set objadostream = server. Createobject ("ADODB. Stream ")
Objadostream. type = 1
Objadostream. open ()
Objadostream. Write (binfiledata)
Objadostream. savetofile filepath, 2
Objadostream. Close ()
Html_temp = html_temp & "<ul>"
%>
<%
Response. Write ("successfully generated file :")
Response. Write ("<br> ")
Response. Write html_temp
Response. Write "<******> history. Go (-1); </******>"
%>
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.