sharewareprograms.txt

来自「一部分关于VB编程的小技巧」· 文本 代码 · 共 34 行

TXT
34
字号
Dim Val1 As Long, Val2 As Long, ValTot As Long, I As Integer
    Dim S As String
    Dim RegCheck As Boolean

    For I = 1 To Len(txtKey1.Text)
        S = Mid(txtKey1.Text, I, 1)
        Val1 = Val1 + Asc(S)
    Next I
    For I = 1 To Len(txtKey2.Text)
        S = Mid(txtKey2.Text, I, 1)
        Val2 = Val2 + Asc(S)
    Next I
    
    ValTot = Val1 + Val2
    
    If ValTot = 1000 Then
        'I just thought of comparing the two strings and there are two similar letters - in addition 
        If Mid(txtKey1.Text, 2, 1) = Mid(txtKey2.Text, 2, 1) Then
            RegCheck = True
        Else
            RegCheck = False
        End If
    Else
        RegCheck = False
    End If


    If RegCheck = True Then
        'ok
    else
        'wrong key
    end if

⌨️ 快捷键说明

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