📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{F0D2F211-CCB0-11D0-A316-00AA00688B10}#1.0#0"; "MSDATLST.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录"
ClientHeight = 1605
ClientLeft = 30
ClientTop = 330
ClientWidth = 3780
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1605
ScaleWidth = 3780
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "登录"
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 360
Left = 2100
TabIndex = 4
Tag = "取消"
Top = 1020
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 495
TabIndex = 3
Tag = "确定"
Top = 1020
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 260
IMEMode = 3 'DISABLE
Left = 1305
PasswordChar = "*"
TabIndex = 1
Top = 525
Width = 2325
End
Begin MSAdodcLib.Adodc Adodc1
Height = 312
Left = 2280
Top = 120
Visible = 0 'False
Width = 1332
_ExtentX = 2355
_ExtentY = 582
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=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\student\teachmanage.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "user "
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 MSDataListLib.DataCombo DataCombo1
Bindings = "frmLogin.frx":0000
DataSource = "Adodc1"
Height = 300
Left = 1200
TabIndex = 5
Top = 120
Width = 972
_ExtentX = 1720
_ExtentY = 582
_Version = 393216
ListField = "kid"
Text = ""
End
Begin VB.Label lblLabels
Caption = "密码(&P):"
Height = 248
Index = 1
Left = 105
TabIndex = 0
Tag = "密码(&P):"
Top = 540
Width = 1080
End
Begin VB.Label lblLabels
Caption = "用户名(&U):"
Height = 248
Index = 0
Left = 105
TabIndex = 2
Tag = "用户名(&U):"
Top = 150
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Private Sub Form_Load()
'Dim sBuffer As String
'Dim lSize As Long
'sBuffer = Space$(255)
'lSize = Len(sBuffer)
'Call GetUserName(sBuffer, lSize)
'If lSize > 0 Then
' txtUserName.Text = Left$(sBuffer, lSize)
'Else
' txtUserName.Text = vbNullString
'End If
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim cn1 As New ADODB.Connection
Dim rs1 As New ADODB.Recordset
l = "select * from user where user='" & datausername & "' and id ='" & txtPassword & "'"
'if rs1.RecordCount =
'rs1.Open l, cnn1, adOpenStatic, adLockOptimistic
'ToDo: 创建测试密码是否正确
'检查正确密码
If txtPassword.Text = "" Then
OK = True
Me.Hide
Else
MsgBox "密码错误,再试一次!", , "登录"
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -