检测函数 asp class
软机网(http://http://www.zjjv.com//):检测函数 asp class
复制代码 代码如下:
<%
DimCmd
SetCmd=NewCls_Command
ClassCls_Command
PrivateRe
PublicFunctionIsPositiveInteger(value)
SetRe=NewRegExp
Re.Pattern="^[1-9][\d]*$"
Re.IgnoreCase=True
Re.Global=True
IsPositiveInteger=Re.Test(value)
SetRe=Nothing
EndFunction
PublicFunctionIsDigit(vString)
IfvString=""ThenIsDigit=False:ExitFunction
SetRe=NewRegExp
Re.Pattern="^[a-z]+$"
Re.Global=True
Re.IgnoreCase=True
Re.MultiLine=True
IsDigit=Re.Test(vString)
SetRe=Nothing
EndFunction
PublicFunctionIsAlpha(vString)
IfvString=""ThenIsAlpha=False:ExitFunction
SetRe=NewRegExp
Re.Pattern="^[\d]+$"
Re.Global=True
Re.IgnoreCase=True
Re.MultiLine=True
IsAlpha=Re.Test(vString)
SetRe=Nothing
EndFunction
PublicFunctionIsAlphaDigit(vString)
IfvString=""ThenIsAlphaDigit=False:ExitFunction
SetRe=NewRegExp
Re.Pattern="^[a-zA-Z\d]+$"
Re.Global=True
Re.IgnoreCase=True
Re.MultiLine=True
IsAlphaDigit=Re.Test(vString)
SetRe=Nothing
EndFunction
DimTemplateContent,TemplateDeBug
PublicSubLoadTemplate(TemplateName)
OnErrorResumeNext
DimTemplateObject,TemplateFile
SetTemplateObject=Server.CreateObject("Scripting.FileSystemObject")
SetTemplateFile=TemplateObject.OpenTextFile(Server.MapPath(TemplateName))
IfErr.Number<>0Then
Err.Clear
SetTemplateFile=Nothing
SetTemplateObject=Nothing
TemplateDeBug=1
EndIf
TemplateContent=TemplateFile.ReadAll
TemplateFile.Close
SetTemplateFile=Nothing
SetTemplateObject=Nothing
EndSub
DimHtmlContent,CreatDeBug
PublicSubBuildFile(Catalogue,HtmlName)
OnErrorResumeNext
IfNotCheckFolder(Catalogue)Then