?? kjxxxt.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 6630
ClientLeft = 60
ClientTop = 345
ClientWidth = 7740
LinkTopic = "Form1"
ScaleHeight = 6630
ScaleWidth = 7740
StartUpPosition = 3 '窗口缺省
Begin MSAdodcLib.Adodc Adodc1
Height = 735
Left = 1080
Top = 5040
Width = 1575
_ExtentX = 2778
_ExtentY = 1296
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:\kj\kjxt.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\kj\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.TextBox text1
DataField = "用戶名"
DataSource = "Adodc1"
Height = 975
Left = 3480
TabIndex = 6
Top = 600
Width = 3255
End
Begin VB.TextBox text2
DataField = "口令"
DataSource = "Adodc1"
Height = 975
Left = 3480
TabIndex = 5
Top = 2280
Width = 3255
End
Begin VB.CommandButton cmdenter
Caption = "注冊"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 4800
TabIndex = 4
Top = 4080
Width = 1815
End
Begin VB.CommandButton cmdcancel
Caption = "取消"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 2520
TabIndex = 3
Top = 4080
Width = 1575
End
Begin VB.CommandButton cmok
Caption = "確定"
BeginProperty Font
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 480
TabIndex = 2
Top = 4080
Width = 1335
End
Begin VB.Label Label2
Caption = "口令"
BeginProperty Font
Name = "隸書"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 480
TabIndex = 1
Top = 2280
Width = 2175
End
Begin VB.Label Label1
Caption = "用戶名"
BeginProperty Font
Name = "隸書"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 855
Left = 480
TabIndex = 0
Top = 720
Width = 2175
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdcancel_Click()
Unload Me
End Sub
Private Sub cmdenter_Click()
Form2.Show
Form1.Hide
End Sub
Private Sub cmok_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 "驗證通過!", vbCritical, "登錄驗證"
Unload Me
MDIForm1.Show
Case Else
MsgBox "驗證錯誤!", vbCritical, "登錄驗證"
End Select
End If
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
End Function
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -