一个ASP的高级模板引擎
这个模板引擎比较方便,跟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(ByVal Str)
c_Char = Str
End Property
Public Property Get Char
Char = c_Char
End Property
' ***************************************
' 设置模板文件夹路径
' ***************************************
Public Property Let Path(ByVal Str)
c_Path = Str
End Property
Public Property Get Path
Path = c_Path
End Property
' ***************************************
' 设置模板文件名
' ***************************************
Public Property Let FileName(ByVal Str)
c_FileName = Str
End Property
Public Property Get FileName
FileName = c_FileName
End Property
' ***************************************
' 获得模板文件具体路径
' ***************************************
Public Property Get FilePath
If Len(Path) > 0 Then Path = Replace(Path, "\", "/")
If Right(Path, 1) <> "/" Then Path = Path & "/"
FilePath = Path & FileName
End Property
' ***************************************
' 设置分页URL
' ***************************************
Public Property Let PageUrl(ByVal Str)
c_PageUrl = Str
End Property
Public Property Get PageUrl
PageUrl = c_PageUrl
End Property
' ***************************************
' 设置分页 当前页
' ***************************************
Public Property Let CurrentPage(ByVal Str)
c_CurrentPage = Str
End Property
Public Property Get CurrentPage
CurrentPage = c_CurrentPage
End Property
' ***************************************
' 输出内容
' ***************************************
Public Property Get Flush
Response.Write(c_Content)
End Property
' ***************************************
' 类初始化
' *******************
相关文档:
<%@ Language=VBScript CODEPAGE=65001%>
<% Response.Buffer=True %>
<%
'Collaboration Data Objects, version 1.2.1(CDO)
'http://www.microsoft.com/downloads/details.aspx?FamilyId=2714320D-C997-4DE1-986F-24F081725D36&displaylang=en
'-----------------第一步 ......
<%
'以下部分是验证提交的page是否为合法的参数
'这部分最好判断一下提交的参数是否为数值字符
dim page
page=Trim(request("page"))
If page="" Then
page=1
Elseif CInt(page)<=0 then
page=1
else
page=CInt(page)
End If
'进行查询,取出要显示的记录
str=rs1("content")
'把出 ......
arr = array(12,52,14,43,24,58,15,64,24,57,17,56,45)
arrLen = ubound(arr)
for i=0 to arrLen-1
for j = 0 to (arrlen -1)-i
if arr(j)>arr(j+1) then
temp = arr(j)
arr(j)= arr(j+1)
arr(j+1) = temp
end if
next
next
for each l in arr
response.Write l&"< ......
asp防止网站挂马找安达互联
您还在担心网站被挂马、被黑吗?安达互联(www. ......
一、正则表达式概述
如果原来没有使用过正则表达式,那么可能对这个术语和概念会不太熟悉。不过,它们并不是您想象的那么新奇。
请回想一下在硬盘上是如何查找文件的。您肯定会使用 ? 和 * 字符来帮助查找您正寻找的文件。? 字符匹配文件名中的单个字符,而 * 则匹配一个或多个字符。一个如 'data?.dat' 的模式可 ......