3 实现
3.1 StaticFile_Class类文件
<%
Class StaticFile_Class
Dim mFilename, mhaserror,mrefreshtime,mfso,mfullfile,mopenfile
Private Sub Class_Initialize
'mrefreshtime是缓存有效时间,单位为秒。当mrefreshtime为-1时不需要刷新;
'比较当前时间和缓存文件的最后修改时间,如果超过该时间,则需要重新生成
mrefreshtime = -1
'mhaserror是使用这个类是否发生错误,为0时没有错误,为-1,则表示缓存文件
'不存在;为-2时,需要刷新缓存文件
mhaserror = 0
'清除对象
Set mfso=Server.CreateObject("Scripting.FileSystemObject")
End Sub
Private Sub Class_Terminate
'清除对象
set mfso = nothing
End Sub
Public Property Let Filename(temps)
mFilename = temps
'生成缓存文件的静态绝对路径
mfullfile = server.Mappath(mFilename)
End Property
Private Property Get Filename()
Filename = mFilename
End Property
Public Property Let refreshtime(t)
mrefreshtime = t
End Property
Private Property Get refreshtime()
refreshtime = mrefreshtime
End Property
public Property Get haserror()
haserror = mhaserror End Property
|