📄 form2.frm
字号:
VERSION 5.00
Begin VB.Form login
BorderStyle = 0 'None
Caption = "登录"
ClientHeight = 6405
ClientLeft = 5085
ClientTop = 2670
ClientWidth = 9585
LinkTopic = "Form2"
ScaleHeight = 6405
ScaleWidth = 9585
ShowInTaskbar = 0 'False
Begin VB.TextBox text2
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 5640
MaxLength = 6
PasswordChar = "*"
TabIndex = 3
Text = "Text2"
Top = 4200
Width = 1815
End
Begin VB.TextBox text1
Appearance = 0 'Flat
Height = 270
IMEMode = 3 'DISABLE
Left = 2040
MaxLength = 15
TabIndex = 2
Text = "Text1"
Top = 4200
Width = 1815
End
Begin VB.CommandButton Command1
BackColor = &H000080FF&
Caption = "确定(&E)"
Default = -1 'True
Height = 375
Left = 3840
Style = 1 'Graphical
TabIndex = 1
Top = 5640
Width = 855
End
Begin VB.CommandButton Command2
BackColor = &H000080FF&
Caption = "取消(&C)"
Height = 375
Left = 4800
Style = 1 'Graphical
TabIndex = 0
Top = 5640
Width = 855
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "密码"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 240
Left = 5160
TabIndex = 7
Top = 3600
Width = 480
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "账号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF00FF&
Height = 240
Left = 1560
TabIndex = 6
Top = 3600
Width = 480
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "Labrary Manage System"
BeginProperty Font
Name = "幼圆"
Size = 36
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF8080&
Height = 720
Left = 840
TabIndex = 5
Top = 600
Width = 7560
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "系统登录"
BeginProperty Font
Name = "华文隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000040C0&
Height = 450
Left = 3720
TabIndex = 4
Top = 1680
Width = 1740
End
Begin VB.Image Image1
Height = 6405
Left = 0
Picture = "Form2.frx":0000
Top = 0
Width = 9600
End
End
Attribute VB_Name = "login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim uid
Dim pwd
Dim strFu As String
Dim strFp As String
strFu = "select * from yh where userid='" & Text1.Text & "'"
If QueryData(strFu) Then
uid = rst.RecordCount
End If
strFp = "select * from yh where pwd='" & Text2.Text & "'"
If QueryData(strFp) Then
pwd = rst.RecordCount
End If
If pwd = 1 And uid = 1 Then
MDIForm1.Show
Unload Me
Else
MsgBox "您输入的用户名或密码有错误!", vbInformation + vbOKOnly, "登录失败"
End If
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
If CnToDB = False Then
MsgBox "网络未响应!出现此情况可能是与服务器没有物理连接或数据库不在指向的服务器上!", vbCritical + vbOKOnly, "Connecting Error"
End If
Text1.Text = ""
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -