📄 formlog.frm
字号:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Formlog
BackColor = &H00FFFFC0&
BorderStyle = 1 'Fixed Single
Caption = "登录系统"
ClientHeight = 2130
ClientLeft = 5865
ClientTop = 4110
ClientWidth = 3990
Icon = "Formlog.frx":0000
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 2130
ScaleWidth = 3990
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 960
Top = 2160
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 582
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 StoneXP.XPFrame XPFrame1
Height = 1575
Left = 0
TabIndex = 4
TabStop = 0 'False
Top = 0
Width = 3975
_ExtentX = 7011
_ExtentY = 2778
Caption = ""
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BackColor = 16777152
Begin VB.TextBox Textname
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1680
TabIndex = 0
ToolTipText = "已注册的用户"
Top = 360
Width = 1935
End
Begin VB.TextBox Textpass
Height = 375
IMEMode = 3 'DISABLE
Left = 1680
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1935
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户名:"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 6
Top = 360
Width = 1200
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "隶书"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 240
TabIndex = 5
Top = 960
Width = 1200
End
End
Begin StoneXP.XPButton XPButton2
Height = 375
Left = 2160
TabIndex = 3
TabStop = 0 'False
Top = 1680
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出"
MouseIcon = "Formlog.frx":F84A
MousePointer = 99
End
Begin StoneXP.XPButton XPButton1
Default = -1 'True
Height = 375
Left = 600
TabIndex = 2
TabStop = 0 'False
Top = 1680
Width = 1095
_ExtentX = 1931
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "确认"
MouseIcon = "Formlog.frx":F9AC
MousePointer = 99
End
End
Attribute VB_Name = "Formlog"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Const maxlogtimes As Integer = 3
Public isOpen As Boolean
Private Sub Form_Load()
ChDrive App.Path
ChDir App.Path
Dim StrConnect As String '连接数据库
StrConnect = App.Path
If Right(StrConnect, 1) <> "\" Then StrConnect = StrConnect + "\"
StrConnect = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & StrConnect & "\kc.mdb"
Adodc1.ConnectionString = StrConnect
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "SELECT * FROM [users]"
Adodc1.Refresh
End Sub
Private Sub XPButton1_Click()
Static logintimes As Integer
logintimes = logintimes + 1
If logintimes > maxlogtimes Then
MsgBox "你已超过允许的登录验证次数!" & vbCr & "应用程序将结束!", vbCritical, "提示信息"
End
Else
If Trim(Textname) = "" Then
MsgBox "请输入用户名! ", vbOKOnly + vbExclamation, "浩天网络"
Textname.SetFocus
Else
With Adodc1.Recordset
If .RecordCount > 0 Then
.MoveFirst
.Find "userid='" & Trim(Textname) & "'"
If .EOF Then
MsgBox Trim(Textname) & "不是系统用户,请检查输入是否正确!", vbCritical, "提示信息"
Textname.SetFocus
Textname.SelStart = 0
Textname.SelLength = Len(Textname)
ElseIf .Fields("password") <> Trim(Textpass) Then
MsgBox "输入的密码有误,请重新输入!", vbCritical, "提示信息"
Textpass.SetFocus
Textpass = ""
Else
userName = .Fields("userid")
userPass = .Fields("password")
userPurview = .Fields("userpurview")
MsgBox "欢迎使用枫叶库管!", vbInformation, "登录成功"
Unload Me
Formmain.Show
End If
End If
End With
End If
End If
End Sub
Private Sub XPButton2_Click()
If MsgBox("你选择了退出系统,退出将不能启动管理系统!" & vbCrLf & "是否真的退出?", vbYesNo, "提示信息") = vbYes Then
isOpen = False
Unload Me
End
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -