📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
Caption = "Form1"
ClientHeight = 4500
ClientLeft = 0
ClientTop = 0
ClientWidth = 6000
LinkTopic = "Form1"
Picture = "Form1.frx":0000
ScaleHeight = 4500
ScaleWidth = 6000
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text2
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 345
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 1
Top = 2640
Width = 1815
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 345
Left = 2400
TabIndex = 0
Top = 2040
Width = 1815
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Height = 495
Left = 120
TabIndex = 2
Top = 480
Width = 5895
End
Begin VB.Image Image2
Height = 255
Left = 3240
MouseIcon = "Form1.frx":3040
MousePointer = 99 'Custom
Top = 3840
Width = 975
End
Begin VB.Image Image1
Height = 255
Left = 1440
MouseIcon = "Form1.frx":3192
MousePointer = 99 'Custom
Top = 3840
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Sub ReleaseCapture Lib "user32" () '支持移动API
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Form_Load()
Text1.BackColor = RGB(83, 82, 132)
Text2.BackColor = RGB(83, 82, 132)
End Sub
Private Sub Image1_Click()
On Error GoTo finish
Set kc1 = cnn.Execute("select * from 登陆 where 用户名='" & Text1.Text & "' and 密码='" & Text2.Text & "'")
If kc1.EOF = True Then
If pnum < 2 Then
pnum = pnum + 1
MsgBox "用户名或密码错误!", vbInformation, "错误次数:" & pnum
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Exit Sub
Else
MsgBox "用户名或密码错误超过三次,系统会自动退出", vbInformation, "提示"
End
End If
Else
If kc1.Fields(2) = "超级管理员" Then
admin = True
Else
admin = False
End If
Unload Me
formmain.Show
End If
Exit Sub
finish:
MsgBox Err.Description
End Sub
Private Sub Image2_Click()
End
End Sub
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ReleaseCapture '以下的移动方式更简便
SendMessage Me.hwnd, &HA1, 2, 0&
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Image1_Click
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Image1_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -