如何清理asp站點(diǎn)緩存的代碼?
<%
Call RemoveAllCache()
Sub RemoveAllCache()
Dim cachelist,i
Call InnerHtml(“UpdateInfo”,”<b>開始執(zhí)行清理當(dāng)前站點(diǎn)緩存</b>:”)
Cachelist=split(GetallCache(),”,”)
If UBound(cachelist)>1 Then
For i=0 to UBound(cachelist)-1
DelCahe Cachelist(i)
Call InnerHtml(“UpdateInfo”,”更新 <b>”&cachelist(i)&”</b> 完成”)
Next
Call InnerHtml(“UpdateInfo”,”更新了”& UBound(cachelist)-1 &”個(gè)緩存對(duì)象<br>”)
Else
Call InnerHtml(“UpdateInfo”,”<b>當(dāng)前站點(diǎn)全部緩存清理完成。</b>。”)
End If
End Sub
Function GetallCache()
Dim Cacheobj
For Each Cacheobj in Application.Contents
GetallCache = GetallCache & Cacheobj & “,”
Next
End Function
Sub DelCahe(MyCaheName)
Application.Lock
Application.Contents.Remove(MyCaheName)
Application.unLock
End Sub
Sub InnerHtml(obj,msg)
Response.Write “<li>”&msg&”</li>”
Response.Flush
End Sub
%>