📄 frmlog.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Frmlog
BorderStyle = 3 'Fixed Dialog
Caption = "登陆窗口"
ClientHeight = 2595
ClientLeft = 5355
ClientTop = 3165
ClientWidth = 5205
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "Frmlog.frx":0000
ScaleHeight = 2595
ScaleWidth = 5205
ShowInTaskbar = 0 'False
Begin VB.CommandButton Command1
Caption = "后台登陆"
Height = 375
Left = 3600
TabIndex = 6
Top = 2040
Width = 975
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 5280
Top = 240
Width = 1200
_ExtentX = 2117
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Cmdexit
BackColor = &H80000014&
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 5
Top = 1560
Width = 975
End
Begin VB.CommandButton Cmdlog
BackColor = &H8000000E&
Caption = "登陆"
Default = -1 'True
Height = 375
Left = 3600
TabIndex = 4
Top = 1080
Width = 975
End
Begin VB.TextBox Txtpassword
BorderStyle = 0 'None
Height = 255
IMEMode = 3 'DISABLE
Left = 1320
PasswordChar = "*"
TabIndex = 3
Top = 1920
Width = 1935
End
Begin VB.TextBox Txtuser
BorderStyle = 0 'None
Height = 255
Left = 1320
TabIndex = 1
Text = "admin"
Top = 1440
Width = 1935
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "密码:"
Height = 375
Left = 240
TabIndex = 2
Top = 1920
Width = 855
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
Caption = "用户ID:"
Height = 255
Left = 240
TabIndex = 0
Top = 1440
Width = 855
End
End
Attribute VB_Name = "Frmlog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub Cmdexit_Click()
Unload Me
End Sub
Private Sub Cmdlog_Click()
'Txtuser.Text = GetMD5("lc")
Dim pss As String
Dim rsUserId As New ADODB.Recordset
Dim bool As Boolean
'打开数据库的连接
If Mcon.State = 0 Then sqlConnect Mcon
'打开用户表
rsUserId.Open "SELECT UserName,UserPW FROM [User]", Mcon, adOpenStatic, adLockBatchOptimistic
Do While Not rsUserId.EOF
sid = rsUserId!UserName
pss = rsUserId!UserPW
bool = False
'判断登陆
If StrComp(sid, Txtuser, 1) = 0 And StrComp(pss, GetMD5(Txtpassword), 1) = 0 Then
bool = True
Unload Me
Exit Do
ElseIf sid <> Txtuser Or pss <> GetMD5(Txtpassword) Then bool = False
End If
rsUserId.MoveNext
Loop
If bool = True Then
menu.Show 1
Exit Sub
Else
MsgBox "用户名或者密码不正确,请重新输入!", , "提示:"
Txtuser = ""
Txtpassword = ""
Txtuser.SetFocus
Exit Sub
End If
End Sub
Private Sub Command1_Click()
frmLogin.Show
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -