?? 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 = 1455
ClientLeft = 2835
ClientTop = 3480
ClientWidth = 3735
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Moveable = 0 'False
ScaleHeight = 859.662
ScaleMode = 0 'User
ScaleWidth = 3506.963
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 1200
Visible = 0 'False
Width = 1575
_ExtentX = 2778
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=dangan"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "dangan"
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "SELECT * FROM 用戶"
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":0442
DataField = "用戶"
DataMember = "用戶名"
DataSource = "DataEnvironment1"
Height = 330
Left = 1200
TabIndex = 5
Top = 120
Width = 2415
_ExtentX = 4260
_ExtentY = 582
_Version = 393216
Style = 2
ListField = "用戶"
Text = ""
Object.DataMember = "用戶名"
End
Begin VB.CommandButton cmdOK
BackColor = &H00FFFFC0&
Caption = "確定"
Default = -1 'True
Height = 390
Left = 1019
TabIndex = 0
Top = 960
Width = 1140
End
Begin VB.CommandButton cmdCancel
BackColor = &H00FFFFC0&
Cancel = -1 'True
Caption = "取消"
Height = 390
Left = 2520
MaskColor = &H00FFFFC0&
TabIndex = 4
Top = 960
UseMaskColor = -1 'True
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 345
IMEMode = 3 'DISABLE
Left = 1200
MaxLength = 10
PasswordChar = "*"
TabIndex = 3
Top = 525
Width = 2415
End
Begin VB.Image Image1
Height = 330
Left = 298
Picture = "frmLogin.frx":047C
Top = 999
Width = 360
End
Begin VB.Label lblLabels
Caption = "用戶名稱(&U):"
Height = 270
Index = 0
Left = 105
TabIndex = 1
Top = 150
Width = 1080
End
Begin VB.Label lblLabels
Alignment = 2 'Center
Caption = "密碼(&P):"
Height = 270
Index = 1
Left = 105
TabIndex = 2
Top = 585
Width = 1080
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
''''''''''''''''''''''''''''
' 該窗體是啟動窗體,并檢驗用戶
'''''''''''''''''''''''''''
Option Explicit
Private Sub cmdCancel_Click()
Unload Me
End
End Sub
Private Sub cmdOK_Click()
Dim yonghu As String
Dim mima, mima2 As String
Dim weizhi As Integer
Dim n As Integer
n = 1
yonghu = Me.DataCombo1.Text '
mima = Me.txtPassword.Text '
weizhi = Me.DataCombo1.SelectedItem '確定所選擇的記錄
Adodc1.Refresh '
Adodc1.Recordset.MoveFirst '
Do Until n = weizhi '
Me.Adodc1.Recordset.MoveNext '
n = n + 1 '
Loop '定位記錄到所選擇的“用戶名”
jibie = Adodc1.Recordset("級別") '設置全局變量“級別”,用在區分不同用戶的功能級別。
If IsNull(Adodc1.Recordset("密碼")) Then '
mima2 = "" '
Else '
mima2 = Adodc1.Recordset("密碼") '
End If '
If mima = mima2 Then '
Formmain.Show '
Me.Hide '
Else '
MsgBox "無效的密碼,請重試!", , "登錄" '
End If '
'
'檢查正確的密碼
'
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -