📄 login.frm
字号:
VERSION 5.00
Begin VB.Form login
Caption = "图书管理系统"
ClientHeight = 3405
ClientLeft = 60
ClientTop = 450
ClientWidth = 4920
BeginProperty Font
Name = "华文琥珀"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
MaxButton = 0 'False
ScaleHeight = 3405
ScaleWidth = 4920
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton Command2
Caption = "取消"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 3
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 2
Top = 2160
Width = 1095
End
Begin VB.TextBox txtpwd
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 1
Top = 1440
Width = 1815
End
Begin VB.TextBox txtuser
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
TabIndex = 0
Top = 840
Width = 1815
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "系统登陆窗口"
BeginProperty Font
Name = "华文行楷"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1080
TabIndex = 6
Top = 240
Width = 2655
End
Begin VB.Label Label2
BackColor = &H80000013&
BackStyle = 0 'Transparent
Caption = "密码"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000007&
Height = 375
Left = 1200
TabIndex = 5
Top = 1440
Width = 615
End
Begin VB.Label Label1
BackColor = &H8000000A&
BackStyle = 0 'Transparent
Caption = "用户名"
BeginProperty Font
Name = "华文行楷"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 375
Left = 1080
TabIndex = 4
Top = 960
Width = 735
End
Begin VB.Image Image1
Height = 7200
Left = -480
Picture = "login.frx":0000
Top = 0
Width = 5475
End
End
Attribute VB_Name = "login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cnt As Integer
Private Sub Command1_Click()
Dim sql As String
Dim rs_login As New ADODB.Recordset
If Trim(txtuser.Text) = "" Then
MsgBox "没有这个用户", vbOKOnly + vbExclamation, ""
txtuser.SetFocus
Else
sql = "select * from 系统管理 where 用户名='" & txtuser.Text & "'"
rs_login.Open sql, conn, adOpenKeyset, adLockPessimistic
If rs_login.EOF = True Then
MsgBox "用户不存在", vbOKOnly + vbExclamation, ""
txtuser.SetFocus
Else
If Trim(rs_login.Fields(1)) = Trim(txtpwd.Text) Then
userID = txtuser.Text
userpow = rs_login.Fields(2)
rs_login.Close
Unload Me
Form1.Show
Else
MsgBox "密码不正确", vbOKOnly + vbExclamation, ""
txtpwd.SetFocus
End If
End If
End If
cnt = cnt + 1
If cnt = 3 Then
Unload Me
End If
Exit Sub
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Dim connectionstring As String
connectionstring = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=图书管理系统"
conn.Open connectionstring
cnt = 0
'Image1.Picture = LoadPicture("e:\my pictures\517_351_11675794220q1228.gif")
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -