earchDataToXml Else WriteContentDataToXml End If End Function
Rem 写具体某条信息的详情xml Private Function WriteContentDataToXml Rem xml未过期则直接退出 Dim xmlfile xmlfile = m_XmlFile If FSOExistsFile(xmlfile) Then If Not isXmlCacheExpired(xmlfile,m_CacheTime) Then Exit Function End If Dim rs Set rs = Server.CreateObject("Adodb.Recordset") Rs.open m_sql,m_DataConn CreateContentXmlFile xmlfile,Rs End Function
Rem 列表和搜索xml数据 Private Function WriteListAndSearchDataToXml Dim sPagesize,TotalPage,CurPage,TotalRec sPagesize = m_PageSize * m_CachePageNum m_CurPage = CLng(m_CurPage) If m_CurPage Mod m_CachePageNum = 0 Then CurPage = m_CurPage/m_CachePageNum Else CurPage = int(clng(m_CurPage)/m_CachePageNum)+1 End If Dim xmlfile xmlfile = getXmlFileName(CurPage) Rem 如果xml未过期则直接退出 If FSOExistsFile(xmlfile) Then If Not isXmlCacheExpired(xmlfile,m_CacheTime) Then Exit Function End If Dim rs Set Rs = Server.CreateObject("Adodb.Recordset") Rs.open m_sql,m_DataConn,1 TotalRec = rs.recordcount rs.pagesize = sPagesize If CurPage>rs.PageCount Then CurPage = rs.PageCount CreateListAndSearchXMLFile xmlfile,TotalRec,Rs,sPagesize End Function Rem 私有方法 Rem 得到文件的最后修改时间 Private Function FSOGetFileLastModifiedTime(file) Dim fso,f,s Set fso=CreateObject("Scripting.FileSystemObject") Set f=fso.GetFile(file) FSOGetFileLastModifiedTime = f.DateLastModified Set f = Nothing Set fso = Nothing End Function
Rem 判断xml缓存是否到期 Private Function isXmlCacheExpired(file,seconds) Dim filelasttime fil |