📄 form2.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form2
Caption = "登陆"
ClientHeight = 4665
ClientLeft = 60
ClientTop = 450
ClientWidth = 6315
LinkTopic = "Form2"
ScaleHeight = 4665
ScaleWidth = 6315
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "注册新用户"
Height = 375
Left = 3840
TabIndex = 6
Top = 3840
Width = 1455
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 1200
Top = 3840
Visible = 0 'False
Width = 2055
_ExtentX = 3625
_ExtentY = 661
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=guan"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "guan"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 系统信息"
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 VB.CommandButton Command2
Caption = "取消"
Height = 615
Left = 3240
TabIndex = 5
Top = 2760
Width = 1575
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 615
Left = 960
TabIndex = 4
Top = 2760
Width = 1575
End
Begin VB.TextBox Text2
Height = 735
IMEMode = 3 'DISABLE
Left = 3120
PasswordChar = "*"
TabIndex = 1
Top = 1680
Width = 2175
End
Begin VB.TextBox Text1
Height = 735
Left = 3120
TabIndex = 0
Top = 720
Width = 2175
End
Begin VB.Label Label2
Caption = "输入密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 960
TabIndex = 3
Top = 1800
Width = 1215
End
Begin VB.Label Label1
Caption = "输入用户名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 2
Top = 960
Width = 1215
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim micount As Integer '用于记录输入密码次数
Private Sub Command1_Click()
Dim sqlstr As String
sqlstr = "select * from 系统信息 where 用户名='" & Text1.Text & "'"
Adodc1.RecordSource = sqlstr
Adodc1.Refresh
If Text1.Text = "" Then '判断用户名是否为空
MsgBox "请输入用户名!", vbExclamation, "警告"
Text2.Text = ""
Text1.SetFocus
ElseIf Adodc1.Recordset.BOF Then '判断用户名是否存在
MsgBox "此用户名不存在,请重新输入!", vbExclamation, "警告"
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
ElseIf Text2.Text = "" Then '判断密码是否为空
MsgBox "请输入密码!", vbExclamation, "警告"
Text2.SetFocus
ElseIf Adodc1.Recordset.Fields("密码") <> Text2.Text Then '判断密码是否正确
MsgBox "密码错误,请重新输入!", vbExclamation, "警告"
Text2.Text = ""
Text2.SetFocus
Else
MDIForm1.Show
Unload Me
End If
micount = micount + 1
If micount = 3 Then Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
form3.Show
Unload Me
End Sub
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -