当前位置: 网学 > 编程文档 > ASP > 正文

检测函数 asp class

来源:Http://myeducs.cn 联系QQ:点击这里给我发消息 作者: 用户投稿 来源: 网络 发布时间: 13/06/17

网学网ASP编辑为广大网友搜集整理了:检测函数 asp class绩等信息,祝愿广大网友取得需要的信息,参考学习

复制代码 代码如下:
<%
Dim Cmd
Set Cmd = New Cls_Command
Class Cls_Command
Private Re

Public Function IsPositiveInteger(value)
Set Re = New RegExp
Re.Pattern = "^[1-9][\d]*$"
Re.IgnoreCase = True
Re.Global = True
IsPositiveInteger = Re.Test(value)
Set Re = Nothing
End Function

Public Function IsDigit(vString)
If vString = "" Then IsDigit = False : Exit Function
Set Re = New RegExp
Re.Pattern = "^[a-z]+$"
Re.Global = True
Re.IgnoreCase = True
Re.MultiLine = True
IsDigit = Re.Test(vString)
Set Re = Nothing
End Function

Public Function IsAlpha(vString)
If vString = "" Then IsAlpha = False : Exit Function
Set Re = New RegExp
Re.Pattern = "^[\d]+$"
Re.Global = True
Re.IgnoreCase = True
Re.MultiLine = True
IsAlpha = Re.Test(vString)
Set Re = Nothing
End Function

Public Function IsAlphaDigit(vString)
If vString = "" Then IsAlphaDigit = False : Exit Function
Set Re = New RegExp
Re.Pattern = "^[a-zA-Z\d]+$"
Re.Global = True
Re.IgnoreCase = True
Re.MultiLine = True
IsAlphaDigit = Re.Test(vString)
Set Re = Nothing
End Function

Dim TemplateContent,TemplateDeBug
Public Sub LoadTemplate(TemplateName)
On Error Resume Next
Dim TemplateObject,TemplateFile
Set TemplateObject=Server.CreateObject("Scripting.FileSystemObject")
Set TemplateFile=TemplateObject.OpenTextFile(Server.MapPath(TemplateName))
If Err.Number <> 0 Then
Err.Clear
Set TemplateFile=Nothing
Set TemplateObject=Nothing
TemplateDeBug=1
End If
TemplateContent=TemplateFile.ReadAll
TemplateFile.Close
Set TemplateFile=Nothing
Set TemplateObject=Nothing
End Sub

Dim HtmlContent,CreatDeBug
Public Sub BuildFile(Catalogue, HtmlName)
On Error Resume Next
If Not CheckFolder(Catalogue) Then
CreatDeBug=1
Exit Sub
End If
Dim CreatObject,CreatFile
Set CreatObject=Server.CreateObject("Scripting.FileSystemObject")
Set CreatFile=CreatObject.CreateTextFile(Server.MapPath(Catalogue & HtmlName),True,False)
If Err.Number <> 0 Then
Set CreatFile=Nothing
Set CreatObject=Nothing
Err.Clear
CreatDeBug=1
Exit Sub
End If
CreatFile.Write(HtmlContent)
CreatFile.Close
Set CreatFile=Nothing
Set CreatObject=Nothing
End Sub

Private Function CheckFolder(byval LocalPath)
On Error Resume Next
Dim FileObject
Dim patharr,path_level,pathtmp,cpath
LocalPath = Replace(LocalPath,"\","/")
Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
patharr = Split(LocalPath,"/")
  • 上一篇资讯: 域名查询系统用到的类
  • 下一篇资讯: 利用ASP规划聊天室
  • 网学推荐

    免费论文

    原创论文

    浏览:
    设为首页 | 加入收藏 | 论文首页 | 论文专题 | 设计下载 | 网学软件 | 论文模板 | 论文资源 | 程序设计 | 关于网学 | 站内搜索 | 网学留言 | 友情链接 | 资料中心
    版权所有 QQ:3710167 邮箱:3710167@qq.com 网学网 [Myeducs.cn] 您电脑的分辨率是 像素
    Copyright 2008-2015 myeducs.Cn www.myeducs.Cn All Rights Reserved
    湘ICP备09003080号