?? frmlogin.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登錄"
ClientHeight = 5910
ClientLeft = 45
ClientTop = 330
ClientWidth = 10065
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "frmLogin.frx":0000
ScaleHeight = 5910
ScaleWidth = 10065
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "登錄"
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 6240
Top = 5520
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=電腦經營系統"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "電腦經營系統"
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 VB.CommandButton cmdOK
Caption = "確定"
Default = -1 'True
Height = 360
Left = 7200
TabIndex = 3
Tag = "確定"
Top = 2520
Width = 900
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 345
Left = 7200
TabIndex = 4
Tag = "取消"
Top = 3480
Width = 945
End
Begin VB.Timer Timer1
Interval = 1000
Left = 9240
Top = 5520
End
Begin VB.TextBox txtPassword
Height = 270
IMEMode = 3 'DISABLE
Left = 3960
MaxLength = 8
PasswordChar = "*"
TabIndex = 2
Top = 3480
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 270
Left = 3960
MaxLength = 6
TabIndex = 1
Top = 2520
Width = 2325
End
Begin VB.Label Label3
BackColor = &H00000000&
Caption = "版本:簡單版"
ForeColor = &H00FFFFFF&
Height = 255
Left = 480
TabIndex = 8
Top = 5160
Width = 1815
End
Begin VB.Label Label2
BackColor = &H00FF8080&
Caption = "歡迎進入圖書銷售管理系統"
BeginProperty Font
Name = "華文彩云"
Size = 21.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1680
TabIndex = 7
Top = 480
Width = 6375
End
Begin VB.Label Label1
BackColor = &H00FF8080&
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFC0C0&
Height = 255
Left = 3240
TabIndex = 6
Top = 1200
Width = 3375
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "密碼(&P):"
ForeColor = &H00FFFFFF&
Height = 255
Index = 1
Left = 1800
TabIndex = 0
Tag = "密碼(&P):"
Top = 3480
Width = 960
End
Begin VB.Label lblLabels
BackColor = &H00FF8080&
Caption = "用戶名(&U):"
ForeColor = &H00FFFFFF&
Height = 255
Index = 0
Left = 1800
TabIndex = 5
Tag = "用戶名(&U):"
Top = 2520
Width = 960
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long
Public OK As Boolean
Private Sub Form_Load()
Call RegisterDataSource
Dim sBuffer As String
Dim lSize As Long
Adodc1.Refresh
users = Adodc1.Recordset("姓名")
passes = Adodc1.Recordset("密碼")
txtUserName.Text = users
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'ToDo: 創建測試密碼是否正確
'檢查正確密碼
xingming = txtUserName.Text
Adodc1.Recordset.MoveFirst
Adodc1.Recordset.Find "姓名=" & "'" & Trim(txtUserName.Text) & "'"
If Adodc1.Recordset.Fields("密碼") = txtPassword.Text Then
OK = True
Me.Hide
Else
i = MsgBox("密碼錯誤,再試一次!", 5 + vbExclamation, "登錄")
If i <> 4 Then
End
Else
txtPassword.Text = ""
txtPassword.SetFocus
txtPassword.SelStart = 0
txtPassword.SelLength = Len(txtPassword.Text)
End If
End If
End Sub
Private Sub Label3_Click()
End Sub
Private Sub Timer1_Timer()
Label1.Caption = Time$ + " " + Str(Year(Date)) + " -" + Str(Month(Date)) + " -" + Str(Day(Date))
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -