<% DirName="html/" '静态文件保存的目录,结尾应带"/" foxrax=Request("foxrax") if foxrax="" then FileName=GetStr()&".html" FileName=replace(FileName,"/","")'替换字符 FileName=replace(FileName,"?","") FileName=replace(FileName,"/","") FileName=DirName&FileName if tesfold(DirName)=false then createfold(Server.MapPath(".")&"/"&DirName) end if if ReportFileStatus(Server.MapPath(".")&"/"&FileName)=true then'文件存在 List=ReadFile(FileName) else'文件不存在的话 List=getHTTPPage(GetUrl()) WriteFile(FileName) end if 'Lists=split(List,"!@#$%") 'Response.write Lists(0) 'Response.end end if '========================函数区============================ '获取当前页面url Function GetStr() On Error Resume Next Dim strTemps strTemps = strTemps & Request.ServerVariables("URL") If Trim(Request.QueryString) <> "" Then strTemps = strTemps & "?" & Trim(Request.QueryString) else strTemps = strTemps end if GetStr = strTemps End Function '获取缓存页面url Function GetUrl() On Error Resume Next Dim strTemp If LCase(Request.ServerVariables("HTTPS")) = "off" Then strTemp = "http://" Else strTemp = "https://" End If strTemp = strTemp & Request.ServerVariables("SERVER_NAME") If Request.ServerVariables("SERVER_PORT") <> 80 Then strTemp = strTemp & ":" & Request.ServerVariables("SERVER_PORT") end if strTemp = strTemp & Request.ServerVariables("URL") If Trim(Request.QueryString) <> "" Then strTemp = strTemp & "?" & Trim(Request.QueryString) & "&foxrax=foxrax" else strTemp = strTemp & "?" & "foxrax=foxrax" end if GetUrl = strTemp End Function '抓取页面 Function getHTTPPage(url) Set Mail1 = Server.CreateObject("CDO.Message") Mail1.CreateMHTMLBody URL,31 AA=Mail1.HTMLBody Set Mail1 = Nothing getHTTPPage=AA End Function '写入文件 Function WriteFile(filename) set fso=createobject("scripting.filesystemobject") filepathx=server.mappath(filename) set f=fso.createtextfile(filepathx,true) f.writeline(list) f.close End Function '读取文件 Public Function ReadFile( xVar ) xVar = Server.Mappath(xVar) Set Sys = Server.CreateObject("Scripting.FileSystemObject") If Sys.FileExists( xVar ) Then Set Txt = Sys.OpenTextFile( xVar, 1 ) msg = Txt.ReadAll Txt.Close Else msg = "无" End If Set Sys = Nothing ReadFile = msg End Function '检测文件是否存在 Function ReportFileStatus(FileName) set fso = server.createobject("scripting.filesystemobject") if fso.fileexists(FileName) = true then ReportFileStatus=true else ReportFileStatus=false end if set fso=nothing end function '检测目录是否存在 function tesfold(foname) set fs=createobject("scripting.filesystemobject") filepathjm=server.mappath(foname) if fs.folderexists(filepathjm) then tesfold=True else tesfold= False end if set fs=nothing end function '建立目录 sub createfold(foname) set fs=createobject("scripting.filesystemobject") fs.createfolder(foname) set fs=nothing end sub %> 然后再你想要的页面加入include就可以了