<% sub InfoToHtml(Aspfile,Par,Beginid,Endid,Htmlfile) '函数用法 '参数说明 'Aspfile 要转换的asp文件,不含.asp 可含路径如/main/index 表示/main/index.asp 'Par asp文件后的参数 'Beginid 开始的id 'Endid 结束的 'Htmlfile 输出的文件名 不含.htm 可含路径如/main/index 表示/main/index.htm dim strUrl,Item_Classid,id,FileName,FilePath,Do_Url,Html_Temp Html_Temp="<UL>" For i=Beginid To Endid Html_Temp = Html_Temp&"<LI>" Item_Classid = i if i=0 then FileName = Htmlfile&".htm" else FileName = Htmlfile&Item_Classid&".htm" end if FilePath = Server.MapPath("/")&"\"&FileName Html_Temp = Html_Temp&FilePath&"</LI>" Do_Url = "http://" Do_Url = Do_Url&Request.Servervariables("SERVER_NAME")&"/"&Aspfile&".asp" Do_Url = Do_Url&"?"&Par&"="&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() Next Html_Temp = Html_Temp&"<UL>"
end sub
%>
<%CALL InfoToHtml("/ShowNews","id","1","3","/news/ShowNews")%> |