📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form FrmLogin
BackColor = &H80000009&
Caption = "网络管理系统"
ClientHeight = 3000
ClientLeft = 60
ClientTop = 345
ClientWidth = 5655
Icon = "FrmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3000
ScaleWidth = 5655
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 2175
Left = 0
Picture = "FrmLogin.frx":08CA
ScaleHeight = 2175
ScaleWidth = 1935
TabIndex = 8
Top = 720
Width = 1935
End
Begin VB.CommandButton cmdCancel
Caption = "关闭"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3960
TabIndex = 7
Top = 2520
Width = 1215
End
Begin VB.CommandButton cmdOk
Caption = "登陆"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2640
TabIndex = 6
Top = 2520
Width = 1215
End
Begin VB.Frame Frame1
BackColor = &H80000009&
Height = 1575
Left = 2040
TabIndex = 1
Top = 720
Width = 3495
Begin VB.TextBox txtPwd
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
IMEMode = 3 'DISABLE
Left = 1080
PasswordChar = "*"
TabIndex = 5
Top = 840
Width = 2175
End
Begin VB.TextBox txtUser
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 345
Left = 1080
TabIndex = 4
Top = 285
Width = 2175
End
Begin VB.Label Label4
BackColor = &H80000009&
Caption = "密 码: "
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 240
TabIndex = 3
Top = 840
Width = 975
End
Begin VB.Label Label3
BackColor = &H80000009&
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 240
TabIndex = 2
Top = 360
Width = 975
End
End
Begin VB.Label Label2
BackColor = &H80000009&
Caption = "系 统 登 陆"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1800
TabIndex = 0
Top = 120
Width = 3135
End
End
Attribute VB_Name = "FrmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/09/25
'描 述:江苏大学网络信息中心网络管理系统 - v1.0 Beta
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Public PasswordKey As String
Public NameKey As String
Public Try_times As Integer
Public result As Boolean
Dim txtSQL As String
Dim MsgText As String
Dim HasError As Boolean
Private Sub cmdCancel_Click()
result = False
Me.Hide
End Sub
Private Sub cmdOk_Click()
Dim j As Single
result = False
On Error GoTo ErrorHandler
'数据有效性检查
If txtUser = "" Then
MsgBox "请输入用户名", vbOKOnly + vbExclamation, "警告"
txtUser.SetFocus
Exit Sub
End If
If txtPwd = "" Then
MsgBox "请输入密码", vbOKOnly + vbExclamation, "警告"
txtPwd.SetFocus
Exit Sub
End If
NameKey = Trim(txtUser)
PasswordKey = Trim(txtPwd)
'判断用户是否存在
txtSQL = "select * from tbl_user where username = '" & NameKey & "'"
Set mrc = ExecuteSQL(txtSQL, MsgText, HasError)
If mrc.EOF Then
MsgBox "用户名不存在", vbOKOnly + vbExclamation, "提示"
Try_times = Try_times + 1
If Try_times >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭", vbOKOnly + vbExclamation, "警告"
result = False
Me.Hide
Exit Sub
Else
Exit Sub
End If
End If
'判断密码是否正确
If mrc.Fields("password") <> PasswordKey Then
MsgBox "密码错误", vbOKOnly + vbExclamation, "提示"
Try_times = Try_times + 1
If Try_times >= 3 Then
MsgBox "您已经三次尝试进入本系统,均不成功,系统将关闭", vbOKOnly + vbExclamation, "警告"
result = False
Me.Hide
Exit Sub
Else
Exit Sub
End If
End If
'登录成功,将当前用户的信息保存在CurUser中
cur_user_id = mrc.Fields("user_id")
cur_username = mrc.Fields("username")
cur_truename = mrc.Fields("truename")
cur_password = mrc.Fields("password")
cur_priv_yhgl = mrc.Fields("priv_yhgl")
cur_priv_jbzlgl = mrc.Fields("priv_jbzlgl")
cur_priv_sbck = mrc.Fields("priv_sbck")
cur_priv_sbdj = mrc.Fields("priv_sbdj")
cur_priv_sbcz = mrc.Fields("priv_sbcz")
cur_priv_sbsx = mrc.Fields("priv_sbsx")
cur_priv_sbtj = mrc.Fields("priv_sbtj")
cur_priv_sbzlxg = mrc.Fields("priv_sbzlxg")
result = True
'关闭自己
Me.Hide
Exit Sub
ErrorHandler:
'Handle Error
If Err.Number <> 0 Or HasError Then
MsgBox "数据库错误:" & Err.Description, vbOKOnly + vbExclamation, "警告"
End If
Me.Hide
End Sub
Private Sub txtPwd_KeyPress(KeyAscii As Integer)
EnterEnter (KeyAscii)
End Sub
Private Sub txtUser_KeyPress(KeyAscii As Integer)
EnterTAB (KeyAscii)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -