module1.bas

来自「对个人写的日记进行加密」· BAS 代码 · 共 27 行

BAS
27
字号
Attribute VB_Name = "Module1"
Option Explicit
Function KaiSa(ByVal s As String, ByVal Key As Integer, ByVal run As Integer) As String
        Dim iLoop     As Long
        Dim i As Integer
        Dim z As Integer
        KaiSa = ""
        i = 0
        z = 2
        For iLoop = 1 To Len(s)
                'KaiSa = KaiSa & ChrB((AscB(MidB(s, iLoop, 1)) + Key + 256) Mod 256)
                'KaiSa = KaiSa + Chr(Asc(Mid(s, iLoop, 1)) + Key)
                KaiSa = KaiSa + Chr(Asc(Mid(s, iLoop, 1)) + Key)
                i = i + 1
                If (i = run) Then
                i = 0
                If (Key >= 0) Then
                Key = Key + z
                z = -z
                Else
                Key = Key - z
                z = -z
                End If
                End If
        Next iLoop
End Function

⌨️ 快捷键说明

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