📄 form4.frm
字号:
VERSION 5.00
Begin VB.Form FormLogin
Caption = "登录"
ClientHeight = 6855
ClientLeft = 60
ClientTop = 450
ClientWidth = 9435
LinkTopic = "Form4"
ScaleHeight = 6855
ScaleWidth = 9435
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access 2000;"
DatabaseName = "C:\Documents and Settings\Administrator\桌面\新建文件夹 (2)\11.mdb"
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 735
Left = 480
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "UserTable"
Top = 480
Visible = 0 'False
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "OK"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2640
TabIndex = 7
Top = 6120
Width = 1335
End
Begin VB.Frame frame1
Caption = "登录"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 3495
Left = 1080
TabIndex = 1
Top = 1560
Width = 7095
Begin VB.TextBox Text2
Height = 615
IMEMode = 3 'DISABLE
Left = 4320
PasswordChar = "*"
TabIndex = 3
Top = 2160
Width = 2415
End
Begin VB.TextBox Text1
Height = 615
Left = 4200
TabIndex = 2
Top = 840
Width = 2535
End
Begin VB.Label Label3
Caption = "用户密码:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 2280
TabIndex = 5
Top = 2040
Width = 1815
End
Begin VB.Label Label2
Caption = "用户名:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2280
TabIndex = 4
Top = 840
Width = 1455
End
Begin VB.Image Image2
Height = 795
Left = 240
Picture = "Form4.frx":0000
Stretch = -1 'True
Top = 1920
Width = 1890
End
Begin VB.Image Image1
Height = 855
Left = 240
Picture = "Form4.frx":2E02
Stretch = -1 'True
Top = 600
Width = 1860
End
End
Begin VB.Label Label4
Caption = "正确输入登录名和密码即可使用本软件,三次错误系统自行断开连接"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 720
TabIndex = 6
Top = 5280
Width = 7695
End
Begin VB.Label Label1
Caption = "图形程序管理系统"
BeginProperty Font
Name = "宋体"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2040
TabIndex = 0
Top = 600
Width = 4215
End
End
Attribute VB_Name = "FormLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public ok As Boolean
Dim miCount As Integer
Private Sub Command1_Click()
Dim txtSQL As String
Dim MsgText As String
UserName = ""
If Trim(Text1.Text) = "" Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告 "
Text1.SetFocus
Else
txtSQL = "select * from UserTable where UserName = 'text1.text'"
If Data1.Recordset.EOF = True Then
MsgBox "没有这个用户,请重新输入用户名!", vbOKOnly + vbExclamation, "警告 "
Text1.SetFocus
Else
Do While Not Data1.Recordset.EOF
If Data1.Recordset.Fields("PassWord").Value = Text2.Text Then
UserName = Text1.Text
ok = True
Me.Hide
Form1.Show
Exit Sub
Else
Me.Data1.Recordset.MoveNext
End If
Loop
End If
End If
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
Private Sub Form_Load()
ok = False
miCount = 0
Me.Data1.DatabaseName = App.Path + "\11.mdb"
Me.Data1.RecordSource = "UserTable"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -