asp產生htm檔案。用xmlhttp得到原始碼。然後用steam流開啟儲存原始碼
來源:互聯網
上載者: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 ( "成功組建檔案:" )
Response.Write ( "<BR>" )
Response.Write Html_Temp
Response.Write "<******>history.go(-1);</******>"
%>