?? frmlogin.frm
字號:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄"
ClientHeight = 3525
ClientLeft = 30
ClientTop = 330
ClientWidth = 5145
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3525
ScaleWidth = 5145
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "Login"
Begin VB.ComboBox Combo1
Height = 300
Left = 1800
TabIndex = 10
Top = 2400
Width = 2295
End
Begin VB.TextBox txtdb
Height = 288
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 8
Top = 1920
Width = 2325
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 2520
TabIndex = 4
Tag = "Cancel"
Top = 3000
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "確定"
Default = -1 'True
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 840
TabIndex = 3
Tag = "OK"
Top = 3000
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 288
IMEMode = 3 'DISABLE
Left = 1788
PasswordChar = "*"
TabIndex = 2
Top = 1488
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 288
Left = 1788
TabIndex = 1
Top = 1092
Width = 2325
End
Begin VB.Label lblLabels
Caption = "數據庫類型"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 3
Left = 360
TabIndex = 9
Top = 2400
Width = 1320
End
Begin VB.Label lblLabels
Caption = "數據庫"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Index = 2
Left = 600
TabIndex = 7
Top = 1920
Width = 1080
End
Begin VB.Label Label1
Caption = "學生信息管理系統"
BeginProperty Font
Name = "華文彩云"
Size = 22.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000002&
Height = 612
Left = 720
TabIndex = 6
Top = 240
Width = 3852
End
Begin VB.Label lblLabels
Caption = "用戶密碼"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Index = 1
Left = 588
TabIndex = 0
Top = 1500
Width = 1080
End
Begin VB.Label lblLabels
Caption = "用戶名"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 252
Index = 0
Left = 720
TabIndex = 5
Tag = "&User Name:"
Top = 1116
Width = 840
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
Private Sub Form_Load()
OK = False 'access to database
miCount = 0
Combo1.AddItem "access"
Combo1.AddItem "oracle"
Combo1.AddItem "sql_server"
End Sub
Private Sub cmdCancel_Click()
OK = False
Unload Me
End Sub
Private Sub cmdok_Click()
Dim txtSQL As String
Dim MsgText As String
'ToDo: create test for correct password
'check for correct password
If Combo1.Text = "" Then
db.db_type = "access"
Else
db.db_type = Combo1.Text 'other database
End If
If db.db_type <> "" Then '不是access數據庫
If Trim(txtdb.Text) <> "" Then
db.db_path = Trim(txtdb.Text) & ";"
End If
End If
db.connect
If Trim(txtUserName.Text = "") Then
MsgBox "沒有這個用戶,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
login_user.user_Id = Trim(txtUserName.Text)
login_user.query
If login_user.State <> 1 Then
MsgBox "沒有這個用戶,請重新輸入用戶名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If login_user.user_pwd = DigestStrToHexStr(Trim(txtPassword.Text)) Then
OK = True
Me.Hide
' UserName = Trim(txtUserName.Text)
Else
MsgBox "輸入密碼不正確,請重新輸入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
miCount = miCount + 1
If miCount = 3 Then
Me.Hide
End If
Exit Sub
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -