如何清理asp站点缓存的代码
<%
Call RemoveAllCache()
Sub RemoveAllCache()
Dim cachelist,i
Call InnerHtml("UpdateInfo","<b>开始执行清理当前站点缓存</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 &"个缓存对象<br>")
Else
Call InnerHtml("UpdateInfo","<b>当前站点全部缓存清理完成。</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
%>
相关文档:
这个模板引擎比较方便,跟HTML结合了
Class template
Private c_Char, c_Path, c_FileName, c_Content, c_PageUrl, c_CurrentPage, c_PageStr, ReplacePageStr
Private TagName
' ***************************************
' 设置编码
' ***************************************
Public Property Let Char( ......
asp中插入与修改数据的几种方式。为了方便解说,我们先建立一个名为test的表,表内只有两个数据
项:username和email,分别用来存储用户名与邮箱地址。
1.利用insert语句插入数据:
insert是sql语句的基本指令之一, 用法很简单,这里我只将其基本格式列出.
代码如下:
set conn=s ......
ASP高级技术精选集
一、GetRows的使用方法:
<%
Set conn=Server.CreateObject("Adodb.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("test.mdb")
Set Rs=Server.CreateObject("Adodb.Recordset")
Rs.Open "Select Top 2 * from 表名",conn,0,1 &nb ......
add.html
<html>
<head>
<title>无组件上传</title>
</head>
<body>
<form method="POST" name="myform" action="xSave.asp" target="_self">
<input name="PicPath" type="text" id="PicPath" readonly="true">
<input name="sPicPath" type="hidden" id="sPi ......
<%
'//////////// GPS:Get Picture Size //////////////
'//////////////利用ADODB.stream获取图片尺寸//////////////
Class GPS
Dim aso
Private Sub Class_Initialize
Set aso=CreateObject("Adodb.Stream")
aso.Mode=3
aso.Type=1
aso.Open
End Sub
Private Sub Class_Terminate
set aso=nothing
En ......