?? mdnumericpassword.bas
字號(hào):
Attribute VB_Name = "MDNumericPassword"
Option Explicit
Public Const GWL_WNDPROC = (-4)
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONDOWN = &H204
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal lpPrevWndFunc As Long, ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Public prevWndProc As Long
Function WndProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If Msg = WM_RBUTTONDOWN Then
Msg = WM_LBUTTONDOWN
End If
WndProc = CallWindowProc(prevWndProc, hwnd, Msg, wParam, lParam)
End Function
'將你輸入的每個(gè)字符轉(zhuǎn)換成密碼數(shù)字
Public Function Fun_NumericPassword(ByVal Password As String) As Long
Dim nValue As Long
Dim ch As Long
Dim Shift1 As Long
Dim Shift2 As Long
Dim i As Integer
Dim Str_Len As Integer
'得到字符串內(nèi)字符的數(shù)目
Str_Len = Len(Password)
'給每個(gè)字符轉(zhuǎn)換成密碼數(shù)字
For i = 1 To Str_Len
ch = Asc(Mid$(Password, i, 1))
nValue = nValue Xor (ch * 2 ^ Shift1)
nValue = nValue Xor (ch * 2 ^ Shift2)
Shift1 = (Shift1 + 7) Mod 19
Shift2 = (Shift2 + 13) Mod 23
Next i
Fun_NumericPassword = nValue
End Function
Public Function Fun_OpenDatFile(i As Boolean) As String
On Error Resume Next
Dim LoadFiles As String
Dim Filenum As Integer
Dim StrTarget As String, NumTarget As Integer
LoadFiles = "fw.dl"
Filenum = FreeFile
'讀取加密文件
Open LoadFiles For Random As Filenum
Get #Filenum, 1, StrTarget '讀取密碼
Get #Filenum, 2, NumTarget '啟動(dòng)密碼登錄開(kāi)關(guān)
Close Filenum
If i = True Then
Fun_OpenDatFile = StrTarget '讀取密碼
Else
Fun_OpenDatFile = NumTarget '啟動(dòng)密碼登錄開(kāi)關(guān)
End If
End Function
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -