📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 6750
ClientLeft = 60
ClientTop = 345
ClientWidth = 7890
LinkTopic = "Form1"
ScaleHeight = 6750
ScaleWidth = 7890
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 1335
Left = 1440
Top = 5160
Width = 5895
_ExtentX = 10398
_ExtentY = 2355
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 2
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kjxt.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=kjxt.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "czy"
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 Command3
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 5640
TabIndex = 6
Top = 4080
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "注册"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 3480
TabIndex = 5
Top = 4080
Width = 1335
End
Begin VB.CommandButton Command1
Caption = "登录"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 1560
TabIndex = 4
Top = 4080
Width = 1335
End
Begin VB.TextBox Text2
DataField = "口令"
DataSource = "Adodc1"
Height = 855
IMEMode = 3 'DISABLE
Left = 3360
PasswordChar = "*"
TabIndex = 3
Top = 2520
Width = 2295
End
Begin VB.TextBox Text1
DataField = "用户名"
DataSource = "Adodc1"
Height = 855
Left = 3360
TabIndex = 1
Top = 1200
Width = 2295
End
Begin VB.Label Label3
Caption = " 会计信息系统"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 840
TabIndex = 7
Top = 120
Width = 5535
End
Begin VB.Label Label2
Caption = "口令"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 1320
TabIndex = 2
Top = 2640
Width = 1455
End
Begin VB.Label Label1
Caption = "用户名"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 1320
TabIndex = 0
Top = 1320
Width = 1575
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim a As String, b As String
Static i As Integer
i = i + 1
If i > 3 Then
MsgBox "你已经超过允许的次数" + Chr(13) + "应用程序将结束!", vbCritical, "登录验证"
End
Else
a = Trim(Text1)
b = Trim(Text2)
Select Case checkpwd(a, b)
Case 0
MsgBox "用户名输入错误!", vbCritical, "登录验证"
Text1.SetFocus
Case 1
MsgBox "口令错误!", vbCritical, "登录验证"
Text2.SetFocus
Case 2
MsgBox "验证通过!", vbMsgBoxRight, "登录验证"
Unload Me
MDIForm1.Show
End Select
End If
End Sub
Private Sub Command2_Click()
Form2.Show
Form1.Hide
End Sub
Private Sub Command3_Click()
Unload Me
End Sub
Private Function checkpwd(ByVal uid As String, ByVal pwd As String) As Byte
'Dim cn As New Connection
'Dim rs As New Recordset
'cn.ConnectionString = Adodc1.ConnectionString
'cn.Open
'Set rs.ActiveConnection = cn
'rs.Open "select * from czy where 用户名='" + uid + "'"
'If rs.EOF Then
' checkpwd = 0
'Else
' If pwd <> rs("口令") Then
' checkpwd = 1
'Else
'checkpwd = 2
' End If
'End If
'cn.Close
'Set rs = Nothing
'Set cn = Nothing
adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + App.Path + "\kjxt.mdb;Persist Security Info=False"
adodc1.CommandType = adCmdTable
adodc1.RecordSource = "select * from czy where 用户名='" + uid + "'"
If adodc1.Recordset.EOF Then
checkpwd = 0
Else
If pwd <> adodc1.Recordset("口令") Then
checkpwd = 1
Else
checkpwd = 2
dqyh = uid
End If
End If
End Function
Private Sub Form_Load()
Text1.Text = ""
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -