?? frmmain.frm
字號:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain
BorderStyle = 1 'Fixed Single
Caption = "讀取 Mixrosoft Access 數據庫密碼"
ClientHeight = 2145
ClientLeft = 45
ClientTop = 330
ClientWidth = 4680
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 2145
ScaleWidth = 4680
StartUpPosition = 2 '屏幕中心
Begin MSComDlg.CommonDialog cdlg
Left = 2100
Top = 825
_ExtentX = 847
_ExtentY = 847
_Version = 393216
DefaultExt = ".mdb"
DialogTitle = "查找 Access 數據庫文件"
Filter = "Microsoft Access 數據庫|*.mdb"
End
Begin VB.Frame famPassWord
Caption = "讀取密碼"
Height = 855
Left = 135
TabIndex = 3
Top = 1125
Width = 4395
Begin VB.CommandButton cmdUnLock
Caption = "解密(&U)"
Default = -1 'True
Height = 310
Left = 3285
TabIndex = 4
Top = 330
Width = 900
End
Begin VB.Label lblPassWord
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Height = 300
Left = 195
TabIndex = 5
Top = 330
Width = 3090
End
End
Begin VB.Frame famDataBaseName
Caption = "Microsoft Access 數據庫"
Height = 855
Left = 135
TabIndex = 0
Top = 135
Width = 4395
Begin VB.CommandButton cmdBrowse
Caption = "瀏覽(&B)"
Height = 310
Left = 3285
TabIndex = 2
Top = 330
Width = 900
End
Begin VB.TextBox txtDBName
Height = 300
Left = 195
TabIndex = 1
Top = 330
Width = 3090
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private DBName$, oldPath$
'Browse database file.
Private Sub cmdBrowse_Click()
lblPassWord.Caption = ""
oldPath$ = DBName$
cdlg.InitDir = DBName$
cdlg.ShowOpen
DBName$ = cdlg.FileName
If DBName$ = "" Then DBName$ = oldPath$: Exit Sub
txtDBName.Text = DBName$
End Sub
'Read database password.
Private Sub cmdUnLock_Click()
'First check the file
'If find file then go on,else exit unlock.
If Dir(txtDBName.Text) = "" Then
'Not find file
MsgBox "指定的數據庫文件并不存在,請重新確定數據庫名。", vbOKOnly + vbCritical, "錯誤"
lblPassWord.Caption = "指定的文件并不存在"
txtDBName.SetFocus
Exit Sub
End If
If LCase(Right(txtDBName.Text, 3)) <> "mdb" Then
'It's not a mdb database
MsgBox "指定的文件并不是一個 Access 數據庫文件。", vbOKOnly + vbCritical, "錯誤"
lblPassWord.Caption = "文件不是 Access 數據庫文件"
Exit Sub
End If
On Error GoTo Err:
Dim strBytes(13) As Byte
Open txtDBName.Text For Binary Access Read As #1
Get #1, 67, strBytes
Close #1
Dim strPW$
strPW = ""
If (strBytes(0) Xor 134) = 0 Then
lblPassWord.Caption = "該數據庫沒有密碼"
Else
strPW = strPW & Chr$(strBytes(0) Xor &H86)
strPW = strPW & Chr$(strBytes(1) Xor &HFB)
strPW = strPW & Chr$(strBytes(2) Xor &HEC)
strPW = strPW & Chr$(strBytes(3) Xor &H37)
strPW = strPW & Chr$(strBytes(4) Xor &H5D)
strPW = strPW & Chr$(strBytes(5) Xor &H44)
strPW = strPW & Chr$(strBytes(6) Xor &H9C)
strPW = strPW & Chr$(strBytes(7) Xor &HFA)
strPW = strPW & Chr$(strBytes(8) Xor &HC6)
strPW = strPW & Chr$(strBytes(9) Xor &H5E)
strPW = strPW & Chr$(strBytes(10) Xor &H28)
strPW = strPW & Chr$(strBytes(11) Xor &HE6)
strPW = strPW & Chr$(strBytes(12) Xor &H13)
lblPassWord.Caption = "該數據庫的密碼為:" + strPW
End If
Exit Sub
Err:
MsgBox "未知的錯誤,無法解讀密碼。", vbCritical, "錯誤"
End Sub
Private Sub Form_Load()
DBName$ = App.Path
End Sub
'Get focus then select all text.
Private Sub txtDBName_GotFocus()
With txtDBName
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -