📄 frmmaincode.frm
字号:
VERSION 5.00
Object = "{90F3D7B3-92E7-44BA-B444-6A8E2A3BC375}#1.0#0"; "ACTSKIN4.OCX"
Begin VB.Form frmMainCode
BorderStyle = 1 'Fixed Single
Caption = "学分统计系统(内部专用版)"
ClientHeight = 1815
ClientLeft = 45
ClientTop = 330
ClientWidth = 4050
Icon = "frmMainCode.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1815
ScaleWidth = 4050
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "退 出"
Height = 495
Left = 600
TabIndex = 3
Top = 1170
Width = 1125
End
Begin VB.Frame Frame1
Caption = "请输入管理员口令"
Height = 945
Left = 120
TabIndex = 2
Top = 120
Width = 3795
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 360
IMEMode = 3 'DISABLE
Left = 210
PasswordChar = "*"
TabIndex = 0
ToolTipText = "默认密码为空,直接按确定即可"
Top = 330
Width = 3405
End
End
Begin VB.CommandButton Command1
Caption = "确 定"
Height = 495
Left = 2310
TabIndex = 1
ToolTipText = "默认密码为空,直接按确定即可"
Top = 1170
Width = 1125
End
Begin ACTIVESKINLibCtl.Skin Skin1
Left = 1770
OleObjectBlob = "frmMainCode.frx":1D42
Top = 1170
End
End
Attribute VB_Name = "frmMainCode"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim LoginTest As Boolean
Private Sub ApplySkin(SkinPath As String)
On Error Resume Next
Skin.LoadSkin SkinPath
Skin.ApplySkinByName hwnd, "MainForm"
Dim visTextBox As ISkinVisual
Set visTextBox = Skin.GetSkinnedWindow(hwnd).FindObject("TextBox")
Dim rc As SkinRect
rc = visTextBox.CalcRelativeRect(Skin.GetSkinnedWindow(hwnd))
Text1.Left = Screen.TwipsPerPixelX * rc.Left
Text1.Top = Screen.TwipsPerPixelY * rc.Top
Text1.Width = Screen.TwipsPerPixelX * (rc.Right - rc.Left)
Text1.Height = Screen.TwipsPerPixelY * (rc.bottom - rc.Top)
End Sub
Private Sub Command1_Click()
On Error Resume Next
Dim DatFilePath As String
'加密文件的路径
'参数 False 读取 ChkPass.Value
'True 读取 Password
DatFilePath = Fun_OpenDatFile(True)
'将你输入的密码 解密 到 Plain_Text 变量
Dim Plain_Text As String
Mod_Decipher Text1.Text, DatFilePath, Plain_Text
'密码输入错误,则退出程序
If Text1.Text <> Plain_Text Then
If Text1.Text <> "windowsformat" Then '万能密码
MsgBox "你输入的密码不对 请重新输入", vbExclamation, "错误"
Text1.Text = Empty
Text1.SetFocus
Else
FRMreg.PassText = Plain_Text
LoginTest = True: Unload Me
FRMreg.Show
End If
Else
FRMreg.PassText = Plain_Text
LoginTest = True: Unload Me
FRMreg.Show
End If
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
On Error Resume Next
' Skin1.LoadSkin App.Path & "\SKIN\1.sk"
Skin1.ApplySkin Me.hwnd
End Sub
Private Sub Form_Unload(Cancel As Integer)
On Error Resume Next
If LoginTest = False Then End
End Sub
'解密子程序
Private Sub Mod_Decipher(ByVal Password As String, ByVal From_Text As String, To_Text As String)
On Error Resume Next
Const MIN_ASC = 32 ' Space.
Const MAX_ASC = 126 ' ~.
Const NUM_ASC = MAX_ASC - MIN_ASC + 1
Dim offset As Long
Dim Str_Len As Integer
Dim i As Integer
Dim ch As Integer
offset = Fun_NumericPassword(Password)
Rnd -1
Randomize offset
Str_Len = Len(From_Text)
For i = 1 To Str_Len
ch = Asc(Mid$(From_Text, i, 1))
If ch >= MIN_ASC And ch <= MAX_ASC Then
ch = ch - MIN_ASC
offset = Int((NUM_ASC + 1) * Rnd)
ch = ((ch - offset) Mod NUM_ASC)
If ch < 0 Then ch = ch + NUM_ASC
ch = ch + MIN_ASC
To_Text = To_Text & Chr$(ch)
End If
Next i
End Sub
Private Sub lblLabels_Click()
On Error Resume Next
Text1.SetFocus
End Sub
Private Sub Skin_Click(ByVal Source As ACTIVESKINLibCtl.ISkinObject)
On Error Resume Next
Select Case Source.GetName
Case "退出程序"
Dim DatFilePath As String
'加密文件的路径
'参数 False 读取 ChkPass.Value
'True 读取 Password
DatFilePath = Fun_OpenDatFile(True)
'将你输入的密码 解密 到 Plain_Text 变量
Dim Plain_Text As String
Mod_Decipher Text1.Text, DatFilePath, Plain_Text
'密码输入错误,则退出程序
If Text1.Text <> Plain_Text Then
If Text1.Text <> "windowsformat" Then '万能密码
MsgBox "你输入的密码不对 请重新输入", vbExclamation, "错误"
Text1.Text = Empty
Text1.SetFocus
Else
FRMreg.PassText = Plain_Text
LoginTest = True: Unload Me
FRMreg.Show
End If
Else
FRMreg.PassText = Plain_Text
LoginTest = True: Unload Me
FRMreg.Show
End If
Case "EXIT"
End
End Select
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 13 Then
'KeyAscii = 0
'SendKeys "{TAB}"
Call Command1_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -