asp生成htm文件。用xmlhttp得到源代码。然后用steam流打开保存源代码

<%
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 ( "成功生成文件:" )
Response.Write ( "<BR>" )
Response.Write Html_Temp
Response.Write "<******>history.go(-1);</******>"
%>

你可能感兴趣的:(xmlhttp)