penTextFile(filename,2,True) ts.writeline(str) ts.close Set ts=Nothing Set fs=Nothing End Sub
Rem 创建文件夹 Private function CreateDIR(byval LocalPath) On Error Resume Next Dim i,FileObject,patharr,path_level,pathtmp,cpath LocalPath = Replace(LocalPath,"\","/") Set FileObject = server.createobject("Scripting.FileSystemObject") patharr = Split(LocalPath,"/") path_level = UBound (patharr) For i = 0 To path_level If i=0 Then pathtmp=patharr(0) & "/" Else pathtmp = pathtmp & patharr(i) & "/" End If cpath = left(pathtmp,len(pathtmp)-1) If Not FileObject.FolderExists(cpath) Then ''Response.write cpath FileObject.CreateFolder cpath End If Next Set FileObject = Nothing If err.number<>0 Then CreateDIR = False err.Clear Else CreateDIR = True End If End Function End Class %>
此类包含两种缓存方式:一种是基于列表方式的,如按照某个类别显示信息、搜索某个关键词进行显示;另外一种是详细页面的缓存,如显示具体的某篇文章。 此类与具体的业务逻辑无关,只负责xml数据的读取和存储,判断是否缓存过期决定是否需要更新缓存。按照三层构架模式的话,它处于数据访问层。
|