?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
Caption = "登錄"
ClientHeight = 4605
ClientLeft = 60
ClientTop = 345
ClientWidth = 7740
LinkTopic = "Form1"
ScaleHeight = 4605
ScaleWidth = 7740
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Caption = "取消"
Height = 375
Left = 3720
TabIndex = 6
Top = 2880
Width = 1215
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Height = 375
Left = 1320
TabIndex = 5
Top = 2880
Width = 1215
End
Begin VB.TextBox txtPassword
Height = 495
IMEMode = 3 'DISABLE
Left = 2640
PasswordChar = "*"
TabIndex = 4
Top = 2040
Width = 2655
End
Begin VB.TextBox txtUsername
Height = 495
Left = 2760
TabIndex = 3
Top = 1320
Width = 2655
End
Begin VB.Label Label4
Alignment = 1 'Right Justify
Caption = "版本提供:DD Software"
BeginProperty Font
Name = "宋體"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3600
TabIndex = 7
Top = 3720
Width = 3855
End
Begin VB.Label Label3
Caption = "用戶密碼"
Height = 375
Left = 480
TabIndex = 2
Top = 2160
Width = 1455
End
Begin VB.Label Label2
Caption = "用戶名"
Height = 375
Left = 480
TabIndex = 1
Top = 1320
Width = 1455
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "學生信息管理系統"
BeginProperty Font
Name = "楷體_GB2312"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 840
TabIndex = 0
Top = 240
Width = 5775
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public OK As Boolean
'判斷登陸次數
Dim miCount As Integer
Dim UserName As String
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'用來存放SQL語句
Dim txtSQl As String
'用來存放記錄集對象
Dim mrc As ADODB.Recordset
'用來存放返回信息
Dim msgtext As String
UserName = ""
'判斷用戶名是否為空
If Trim(txtUsername = "") Then
MsgBox "沒有這個用戶,請重新輸入!", vbOKOnly + vbInformation, "警告!"
txtUsername.SetFocus
Else
'查尋指定用戶名記錄
txtSQl = "select* from user_info where user_id='" & txtUsername.Text & "'"
'執行查詢語句
Set mrc = ExecuteSQL(txtSQl, msgtext)
If mrc.EOF Then
MsgBox "沒有這個用戶,請重新輸入!", vbOKOnly + vbInformation, "警告!"
txtUsername.SetFocus
Else
'判斷密碼是否正確
If Trim(mrc.Fields(1)) = Trim(txtPassword.Text) Then
OK = True
mrc.Close
Me.Hide
UserName = Trim(txtUsername.Text)
Else
MsgBox "密碼錯誤!請重新輸入。", vbOKOnly + vbInformation, "系統信息!"
txtPassword = ""
txtPassword.SetFocus
End If
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
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -