?? frmlogin.frm
字號(hào):
VERSION 5.00
Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
Begin VB.Form frmLogin
BackColor = &H80000013&
BorderStyle = 3 'Fixed Dialog
ClientHeight = 1575
ClientLeft = 2835
ClientTop = 3195
ClientWidth = 4005
ControlBox = 0 'False
Icon = "frmLogin.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 930.561
ScaleMode = 0 'User
ScaleWidth = 3760.478
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.Frame Frame1
Height = 1935
Left = -120
TabIndex = 0
Top = -120
Width = 4455
Begin Threed.SSCommand cmdOK
Height = 360
Left = 1080
TabIndex = 5
Top = 1200
Width = 1140
_Version = 65536
_ExtentX = 2011
_ExtentY = 635
_StockProps = 78
Caption = "&A.確 定"
Font3D = 1
End
Begin VB.TextBox txtPassword
Appearance = 0 'Flat
Height = 325
IMEMode = 3 'DISABLE
Left = 1065
PasswordChar = "*"
TabIndex = 2
Top = 765
Width = 2685
End
Begin VB.TextBox txtUser
Appearance = 0 'Flat
Height = 325
Left = 1080
TabIndex = 1
Top = 360
Width = 2685
End
Begin Threed.SSCommand cmdCancel
Height = 360
Left = 2520
TabIndex = 6
Top = 1200
Width = 1140
_Version = 65536
_ExtentX = 2011
_ExtentY = 635
_StockProps = 78
Caption = "取 消(&Q)"
Font3D = 1
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "密 碼(&P)"
Height = 270
Index = 1
Left = 240
TabIndex = 4
Top = 792
Width = 1080
End
Begin VB.Label lblLabels
BackStyle = 0 'Transparent
Caption = "用 戶(&U)"
Height = 270
Index = 0
Left = 240
TabIndex = 3
Top = 387
Width = 1080
End
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim WithEvents rs As Recordset
Attribute rs.VB_VarHelpID = -1
Private Sub cmdCancel_Click()
'設(shè)置全局變量為 false
'不提示失敗的登錄
End
End Sub
Private Sub cmdOK_Click()
Dim Sql As String
Sql = "select * from t_user where usercode='" & Trim$(Me.txtUser) & "' and password='" & Trim$(Me.txtPassword) & "'"
Set rs = ConnWZ.Execute(Sql)
If Not rs.EOF Then
With UserInfo
.UserCode = Trim$(rs!UserCode)
.UserName = Trim$(rs!UserName)
.Pwd = Trim$(rs!Password)
.QX = rs!QX
End With
'Call LogInfo(True)
Me.Hide
RSGL.Show
rs.Close
Exit Sub
Else '
MsgBox "用戶名或口令輸入錯(cuò)誤!", vbExclamation, "系統(tǒng)提示"
txtUser.Text = ""
txtUser.SetFocus
txtPassword.Text = ""
rs.Close
Exit Sub
End If
Err:
MsgBox "用戶名、口令或數(shù)據(jù)庫連接串輸入錯(cuò)誤!數(shù)據(jù)庫連接失敗!", vbExclamation, "系統(tǒng)提醒你:"
End Sub
Private Sub Form_Load()
Dim Sql As String
Me.txtPassword = ""
With Me.txtUser
.Text = ""
.SelStart = 0
.SelLength = Len(.Text)
End With
Sql = "select * from t_user"
Set rs = ConnWZ.Execute(Sql)
If rs.EOF Then
Sql = "insert t_user(usercode,username,password,qx) values('Admin','管理員','123456',0)"
ConnWZ.Execute (Sql)
End If
rs.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub txtpassword_keypress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call cmdOK_Click
End If
End Sub
Private Sub txtUser_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
txtPassword.SetFocus
End If
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -