c1.cls

来自「asp+sql2000做的oa软件+vb制作的组件源码」· CLS 代码 · 共 49 行

CLS
49
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "c1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Dim xgKey As String

Public Function Encrypt(s As String)
   Dim i, j As Byte
   Dim rs As String
   i = 1
   j = 1
   For i = 1 To Len(s)
     rs = rs + Chr(Asc(Mid(s, i, 1)) Xor Asc(Mid(xgKey, j, 1)))
     j = j + 1
     If j > Len(xgKey) Then j = Len(xgKey)
   Next i
   Encrypt = rs
End Function

Public Function dEncrypt(s As String)
   Dim i, j As Byte
   Dim rs As String
   i = 1
   j = 1
   For i = 1 To Len(s)
     rs = rs + Chr(Asc(Mid(s, i, 1)) Xor Asc(Mid(xgKey, j, 1)))
     j = j + 1
     If j > Len(xgKey) Then j = Len(xgKey)
   Next i
   dEncrypt = rs
End Function

Private Sub Class_Initialize()
   Open "C:\WINNT\system32\xgcript\xgkey.xgk" For Input As #1
   Input #1, xgKey
   Close #1
End Sub

⌨️ 快捷键说明

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