?? login_frm.frm
字號:
VERSION 5.00
Begin VB.Form login_frm
BorderStyle = 1 'Fixed Single
Caption = "密碼窗口"
ClientHeight = 3000
ClientLeft = 5850
ClientTop = 4950
ClientWidth = 4965
LinkTopic = "Form4"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "login_frm.frx":0000
ScaleHeight = 3000
ScaleWidth = 4965
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdCancel
Caption = "取消(&Cancel)"
BeginProperty Font
Name = "幼圓"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 2400
TabIndex = 7
Top = 1920
Width = 1335
End
Begin VB.CommandButton cmdOK
Caption = "確定(&OK)"
BeginProperty Font
Name = "幼圓"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
Left = 960
TabIndex = 2
Top = 1920
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 1320
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 1800
TabIndex = 0
Top = 720
Width = 1935
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "Copyleft 2004 ,Version 1.0.0"
BeginProperty Font
Name = "宋體"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 255
Left = 720
TabIndex = 6
Top = 2520
Width = 2940
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "姓名:"
BeginProperty Font
Name = "幼圓"
Size = 11.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 312
Left = 792
TabIndex = 5
Top = 780
Width = 972
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
Caption = "密碼:"
BeginProperty Font
Name = "幼圓"
Size = 11.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 375
Left = 795
TabIndex = 4
Top = 1320
Width = 1035
End
Begin VB.Label Label3
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "密碼輸入"
BeginProperty Font
Name = "楷體_GB2312"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00404040&
Height = 315
Left = -600
TabIndex = 3
Top = 240
Width = 4035
End
Begin VB.Image Image1
Height = 12630
Left = -2760
Picture = "login_frm.frx":B947
Top = -2520
Width = 16845
End
End
Attribute VB_Name = "login_frm"
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 Const sign = "用戶消息框"
Private Sub cmdCancel_Click()
ok = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
Dim txtSql As String
Dim rs1 As New ADODB.Recordset
UserName = "" '全局變量
Right1 = ""
If Trim(Text1.Text) = "" Then
MsgBox "沒有此用戶,請重新輸入用戶名!", vbExclamation, sign
Text1.SetFocus
Exit Sub
Else
'驗證密碼
txtSql = "SELECT * FROM 密碼 WHERE 用戶名='" & Trim(Text1.Text) & "'"
rs1.Open txtSql, con, adOpenDynamic, adLockOptimistic, adCmdText
If rs1.EOF = True Then
MsgBox "沒有此用戶,請重新輸入!", vbExclamation, sign
Text1.Text = Empty
Text1.SetFocus
Else
If Trim(Text2.Text) = Trim(rs1.Fields(1)) Then
ok = True '標記
UserName = Trim(Text1.Text)
OldPassword = Trim(Text2.Text)
Right1 = Trim(rs1.Fields(2))
rs1.Close
Me.Hide
Else
MsgBox "密碼不正確!請重新輸入!", vbExclamation, sign
Text2.SetFocus
Text2.Text = ""
End If
End If
End If
MiCount = MiCount + 1
If MiCount = 3 Then
Me.Hide
End If
End Sub
Private Sub Form_Load()
ok = False '標記
MiCount = 0
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Text2.SetFocus
End If
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
cmdOK.SetFocus
End If
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -