⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 constructors.cls

📁 VB 加密----------能够加密解密控件
💻 CLS
📖 第 1 页 / 共 5 页
字号:
''
' Creates a new KeySizes object with the Min, Max and Skip sizes defined.
'
' @param MinSize The smallest key size defined by this KeySizes instance.
' @param MaxSize The largest key size defined by this KeySizes instance.
' @param SkipSize The step size from MinSize to MaxSize of legal key sizes
' between the smallest and largest legal key sizes in this instance.
' @return A new KeySizes object with the Min, Max and Skip sizes defined.
' @remarks A KeySizes object represents a set of legal key sizes. It defines all the possible
' legal key sizes by defining the smallest and largest key sizes allows, then defining a step
' size used to calculate the additional legal key sizes between the smallest and largest key sizes.
' <p>If the smallest key size is 64 and the largest key size is 128 and a skip size of 32 is defined,
' then all possible legal key sizes are from 64 to 128 in increments of 32. In this case, the valid
' key sizes are 64, 96 and 128.</p>
' @see KeySizes
'
Public Function NewKeySizes(ByVal MinSize As Long, ByVal MaxSize As Long, ByVal SkipSize As Long) As KeySizes
    Set NewKeySizes = New KeySizes
    Call NewKeySizes.Init(MinSize, MaxSize, SkipSize)
End Function

''
' Creates a new FromBase64Transform object used to convert base64 characters to plain text.
'
' @param WhiteSpaces Determines how whitespace should be handled during the transformation process.
' @return A new FromBase64Transfrom object.
' @see FromBase64Transform
'
Public Function NewFromBase64Transform(ByVal WhiteSpaces As FromBase64TransformMode) As FromBase64Transform
    Set NewFromBase64Transform = New FromBase64Transform
    Call NewFromBase64Transform.Init(WhiteSpaces)
End Function

''
' Creates a new CryptoStream object used to read or write transformed data to or from an underlying stream.
'
' @param Stream The underlying stream to read or write the transformed data.
' @param Transform The object used to transfrom data to or from plain text.
' @param Mode Sets the CryptoStream to be either in read mode or write mode.
' @return A new CryptoStream object.
' @see CryptoStream
'
Public Function NewCryptoStream(ByVal Stream As Stream, ByVal Transform As ICryptoTransform, ByVal Mode As CryptoStreamMode) As CryptoStream
    Set NewCryptoStream = New CryptoStream
    Call NewCryptoStream.Init(Stream, Transform, Mode)
End Function

''
' Returns an array of Longs generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a Long or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewLongs(ParamArray Values() As Variant) As Long()
    Dim Ret()   As Long
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbLong, 0, 0)
    End If
    
    NewLongs = Ret
End Function

''
' Returns an array of Bytes generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a byte or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewBytes(ParamArray Values() As Variant) As Byte()
    Dim Ret()   As Byte
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbByte, 0, 0)
    End If
    
    NewBytes = Ret
End Function

''
' Returns an array of Integers generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to an Integer or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewIntegers(ParamArray Values() As Variant) As Integer()
    Dim Ret()   As Integer
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbInteger, 0, 0)
    End If
    
    NewIntegers = Ret
End Function

''
' Returns an array of Strings generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a String or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewStrings(ParamArray Values() As Variant) As String()
    Dim Ret()   As String
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbString, 0, 0)
    End If
    
    NewStrings = Ret
End Function

''
' Returns an array of Singles generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a Single or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewSingles(ParamArray Values() As Variant) As Single()
    Dim Ret()   As Single
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbSingle, 0, 0)
    End If
    
    NewSingles = Ret
End Function

''
' Returns an array of Doubles generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a Double or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewDoubles(ParamArray Values() As Variant) As Double()
    Dim Ret()   As Double
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbDouble, 0, 0)
    End If
    
    NewDoubles = Ret
End Function

''
' Returns an array of Date values generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to dates or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewDates(ParamArray Values() As Variant) As Date()
    Dim Ret()   As Date
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbDate, 0, 0)
    End If
    
    NewDates = Ret
End Function

''
' Returns an array of Currency values generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to Currency or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewCurrencys(ParamArray Values() As Variant) As Currency()
    Dim Ret()   As Currency
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbCurrency, 0, 0)
    End If
    
    NewCurrencys = Ret
End Function

''
' Returns an array of Boolean values generated from the values passed in.
'
' @param Values The values to create the array from.
' @remarks The values need to be convertable to a boolean or an exception will occur.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewBooleans(ParamArray Values() As Variant) As Boolean()
    Dim Ret()   As Boolean
    Dim ub      As Long
    
    ub = UBound(Values)
    If ub >= 0 Then
        ReDim Ret(0 To ub)
        Dim i As Long
        For i = 0 To ub
            Ret(i) = Values(i)
        Next i
    Else
        SAPtr(Ret) = SafeArrayCreateVector(vbBoolean, 0, 0)
    End If
    
    NewBooleans = Ret
End Function

''
' Returns a Variant array containing the values passed in.
'
' @param Values The values to create the array from.
' @remarks This is the same as using the Array function.
' <p>The array is zero-based.</p>
' <p>If no values are passed in then an empty array is returned, not a null array.</p>
'
Public Function NewVariants(ParamArray Values() As Variant) As Variant()
    NewVariants = Values
End Function

''
' Creates a new CspKeyContainerInfo object.
'
' @param Parameters The parameters used to derive information from.
' @return A new CspKeyContainerInfo object

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -