SoFunction
Updated on 2025-04-09

Detection function asp class


<%
Dim Cmd
Set Cmd = New Cls_Command
Class Cls_Command
    Private Re

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

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

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

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

    Dim TemplateContent,TemplateDeBug
    Public Sub LoadTemplate(TemplateName)
        On Error Resume Next
        Dim TemplateObject,TemplateFile
        Set TemplateObject=("")
        Set TemplateFile=((TemplateName))
        If  <> 0 Then
            
            Set TemplateFile=Nothing
            Set TemplateObject=Nothing
            TemplateDeBug=1
        End If
        TemplateContent=
        
        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=("")
        Set CreatFile=((Catalogue & HtmlName),True,False)
        If  <> 0 Then
            Set CreatFile=Nothing
            Set CreatObject=Nothing
            
            CreatDeBug=1
            Exit Sub
        End If
        (HtmlContent)
        
        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=("") 
        patharr = Split(LocalPath,"/") 
        path_level = Ubound(patharr)
        Dim i
        For i = 0 to path_level 
            If i = 0 Then 
                pathtmp = patharr(0) & "/"
            Else
                pathtmp = pathtmp & patharr(i) & "/"
            End If
            cpath = Left(pathtmp,Len(pathtmp)-1)
            If Not ((cpath)) Then ((cpath))
        Next
        Set FileObject=Nothing
        If <>0 then
            
            CheckFolder = False
        Else
            CheckFolder = True
        End If
    End Function

    Public Function WriteCache(appName, Value)
        
        Application(appName) = Value
        
    End Function

    Public Function ClearCache(appName)
        
        (appName)
        
    End Function

    Public Sub OutputJavaInfo(Message)
         = 0
         = Now() - 1
         "pragma","no-cache"
         "cache-control","private"
         = "no-cache"
         = "application/x-javascript"
         "(""updateinfo"").innerHTML = """ & Message & """;"
        
    End Sub

    Public Sub OutputinterHtml(Message, ShowType)
         Message
        If ShowType = 1 Then
            
        Else
            
        End If
    End Sub
End Class
%>