?? frmpassword.frm
字號:
VERSION 5.00
Begin VB.Form frmPassword
Caption = "氧樂果合成微機控制工程用戶密碼窗口"
ClientHeight = 2160
ClientLeft = 45
ClientTop = 330
ClientWidth = 3810
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2160
ScaleWidth = 3810
StartUpPosition = 2 '屏幕中心
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游標
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 324
Left = 0
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = "user"
Top = 1920
Visible = 0 'False
Width = 912
End
Begin VB.TextBox txtName
Alignment = 2 'Center
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
IMEMode = 3 'DISABLE
Left = 1800
TabIndex = 0
Top = 240
Width = 1692
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Caption = "取消&C"
Height = 340
Left = 2280
MouseIcon = "frmPassword.frx":0000
MousePointer = 99 'Custom
TabIndex = 3
Top = 1560
Width = 800
End
Begin VB.CommandButton Command1
Caption = "確定&O"
Height = 340
Left = 720
MouseIcon = "frmPassword.frx":0152
MousePointer = 99 'Custom
TabIndex = 2
Top = 1560
Width = 800
End
Begin VB.TextBox txtPassword
Alignment = 2 'Center
BeginProperty Font
Name = "宋體"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 372
IMEMode = 3 'DISABLE
Left = 1800
PasswordChar = "*"
TabIndex = 1
Top = 960
Width = 1692
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "請輸入用戶名:"
BeginProperty Font
Name = "隸書"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 5
Top = 306
Width = 1680
End
Begin VB.Image Image1
BorderStyle = 1 'Fixed Single
Height = 2124
Left = 24
Top = 0
Width = 3768
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "請輸入密碼:"
BeginProperty Font
Name = "隸書"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 240
TabIndex = 4
Top = 1032
Width = 1440
End
End
Attribute VB_Name = "frmPassword"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Option Compare Text
Private mintEventChar As String
Private Sub Command1_Click()
Call PassWord(Me.EventChar)
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Public Property Get EventChar() As String
EventChar = mintEventChar
End Property
Public Property Let EventChar(ByVal vData As String)
mintEventChar = vData
End Property
Private Sub Form_Load()
Set UserDB = DBEngine.Workspaces(0).OpenDatabase("d:\ylg2\csdata\user.mdb", False, False, ";pwd=yangzhixiao")
Set UserRec = UserDB.OpenRecordset("user")
End Sub
Private Sub txtName_GotFocus()
Call GotFocusAgain(txtName)
End Sub
Private Sub txtName_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = vbKeyReturn Then txtPassword.SetFocus
End Sub
Private Sub txtPassword_GotFocus()
Call GotFocusAgain(txtPassword)
End Sub
Private Sub txtPassword_KeyDown(KeyCode As Integer, Shift As Integer)
On Error Resume Next
If KeyCode = vbKeyReturn Then Call PassWord(Me.EventChar)
End Sub
Private Sub PassWord(ByVal strEvent As String)
Dim i, RecNum As Integer
Dim PauseKaiDu(1 To 3) As Single
Dim FindUser As Boolean
FindUser = False
With UserRec
.MoveFirst
Do While Not (.EOF)
If .Fields("name") = txtName.Text And .Fields("password") = txtPassword.Text Then
FindUser = True
GoTo s
End If
.MoveNext
Loop
If FindUser = False Then
Call Inform(31)
txtName.SetFocus
Exit Sub
End If
s: gstrUserName = txtName.Text
gstrUserType = .Fields("type")
End With
Unload frmPassword
Select Case Me.EventChar
Case "mainfrm.show"
gstrCaoZuo = "進入系統"
mainfrm.Show
Call WriteBlackBox
Case "update canshu"
If gstrUserType <> "管理員" Then
Call Inform(33)
Else
With frmCanShu
.Updatable = True
gstrCaoZuo = "修改參數"
Call WriteBlackBox
For i = 0 To 3
.dbg1(i).AllowUpdate = True
Next
.cmdOK.Enabled = True
End With
End If
Case "fyf1touliao"
gstrCaoZuo = "1#釜建立反應"
With fyftlfrm
.Index = 1
.Show vbModal
End With
Case "fyf2touliao"
gstrCaoZuo = "2#釜建立反應"
With fyftlfrm
.Index = 2
.Show vbModal
End With
Case "fyf3touliao"
gstrCaoZuo = "3#釜建立反應"
With fyftlfrm
.Index = 3
.Show vbModal
End With
Case "fyf1xiuzheng"
gstrCaoZuo = "1#釜修正投料"
With fyftlfrm
.IsZhuiJia = True
.Index = 1
.Label1.Caption = "請輸入精酯修正量(kg):"
.Show vbModal
End With
Case "fyf2xiuzheng"
gstrCaoZuo = "2#釜修正投料"
With fyftlfrm
.Show vbModal
.IsZhuiJia = True
.Index = 2
.Label1.Caption = "請輸入精酯修正量"
End With
Case "fyf3xiuzheng"
gstrCaoZuo = "3#釜修正投料"
With fyftlfrm
.Show vbModal
.IsZhuiJia = True
.Index = 3
.Label1.Caption = "請輸入精酯修正量"
End With
Case "fyf1chuliang"
gstrCaoZuo = "輸入一號釜反應結果信息"
With frmChuLiang
.fyfNum = 1
.Show vbModal
End With
Case "fyf2chuliang"
gstrCaoZuo = "輸入二號釜反應結果信息"
With frmChuLiang
.fyfNum = 2
.Show vbModal
End With
Case "fyf3chuliang"
gstrCaoZuo = "輸入三號釜反應結果信息"
With frmChuLiang
.fyfNum = 3
.Show vbModal
End With
Case "fyf1pause"
gstrCaoZuo = "1#反應釜暫停反應"
With mainfrm.fyf1_Control
PauseKaiDu(1) = .tlfaKaiDu
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
gIsTouLiao(1) = False
End With
mainfrm.mnuGoOn1.Enabled = True
Call WriteBlackBox
Case "fyf1goon"
gstrCaoZuo = "1#反應釜繼續反應"
With mainfrm.fyf1_Control
Call A_out(.tlfBaseAddress, .tlfChannel, PauseKaiDu(1), 0)
gIsTouLiao(1) = True
End With
mainfrm.mnuGoOn1.Enabled = False
Call WriteBlackBox
Case "fyf1stop"
gstrCaoZuo = "1#反應釜異常終止"
With mainfrm.fyf1_Control
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
End With
Call mainfrm.TouLiaoWanBi(1)
Call WriteBlackBox
Case "resume1"
gstrCaoZuo = "1#反應釜恢復反應"
With Batchlsrs(1)
.MoveLast
mainfrm.fyf1_Control.jlgcsYeWei = .Fields("chushiyewei")
mainfrm.fyf1_Control.jlgjsYeWei = .Fields("jieshuyewei")
End With
With mainfrm.fyf1_Control
If gblnIsAuto(1) Then Call A_out(.tlfBaseAddress, .tlfChannel, 100, 0)
.WorkState = True
mainfrm.tmrControl(0).Enabled = True
End With
Call WriteBlackBox
Case "fyf2pause"
gstrCaoZuo = "2#反應釜暫停反應"
With mainfrm.fyf2_Control
PauseKaiDu(2) = .tlfaKaiDu
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
gIsTouLiao(2) = False
End With
mainfrm.mnuGoOn2.Enabled = True
Call WriteBlackBox
Case "fyf2goon"
gstrCaoZuo = "2#反應釜繼續反應"
With mainfrm.fyf2_Control
Call A_out(.tlfBaseAddress, .tlfChannel, PauseKaiDu(2), 0)
gIsTouLiao(2) = True
End With
mainfrm.mnuGoOn2.Enabled = False
Call WriteBlackBox
Case "fyf2stop"
gstrCaoZuo = "2#反應釜異常終止"
With mainfrm.fyf2_Control
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
End With
Call mainfrm.TouLiaoWanBi(2)
Call WriteBlackBox
Case "resume2"
gstrCaoZuo = "2#反應釜恢復反應"
With Batchlsrs(2)
.MoveLast
mainfrm.fyf2_Control.jlgcsYeWei = .Fields("chushiyewei")
mainfrm.fyf2_Control.jlgjsYeWei = .Fields("jieshuyewei")
End With
With mainfrm.fyf2_Control
If gblnIsAuto(2) Then Call A_out(.tlfBaseAddress, .tlfChannel, 100, 0)
.WorkState = True
mainfrm.tmrControl(1).Enabled = True
End With
Call WriteBlackBox
Case "fyf3pause"
gstrCaoZuo = "3#反應釜暫停反應"
With mainfrm.fyf3_Control
PauseKaiDu(3) = .tlfaKaiDu
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
gIsTouLiao(3) = False
End With
mainfrm.mnuGoOn3.Enabled = True
Call WriteBlackBox
Case "fyf3goon"
gstrCaoZuo = "3#反應釜繼續反應"
With mainfrm.fyf3_Control
Call A_out(.tlfBaseAddress, .tlfChannel, PauseKaiDu(3), 0)
gIsTouLiao(3) = True
End With
mainfrm.mnuGoOn3.Enabled = False
Call WriteBlackBox
Case "fyf3stop"
gstrCaoZuo = "3#反應釜異常終止"
With mainfrm.fyf3_Control
Call A_out(.tlfBaseAddress, .tlfChannel, 0, 0)
End With
Call mainfrm.TouLiaoWanBi(3)
Call WriteBlackBox
Case "resume3"
gstrCaoZuo = "3#反應釜恢復反應"
With Batchlsrs(3)
.MoveLast
mainfrm.fyf3_Control.jlgcsYeWei = .Fields("chushiyewei")
mainfrm.fyf3_Control.jlgjsYeWei = .Fields("jieshuyewei")
End With
With mainfrm.fyf3_Control
If gblnIsAuto(3) Then Call A_out(.tlfBaseAddress, .tlfChannel, 100, 0)
.WorkState = True
mainfrm.tmrControl(2).Enabled = True
End With
Call WriteBlackBox
Case "addnewuser"
If gstrUserType = "管理員" Or gstrUserType = "工程師" Then
frmUser.mblnAllowAddnew = True
gstrCaoZuo = "建立新用戶"
Call WriteBlackBox
Call Inform(42)
Else
Call Inform(33)
End If
Case "changeuser"
If gstrUserType = "管理員" Or gstrUserType = "工程師" Then
frmUser.mblnAllowChange = True
gstrCaoZuo = "修改用戶名或密碼"
Call WriteBlackBox
Call Inform(42)
Else
Call Inform(33)
End If
Case "deleteuser"
If gstrUserType = "管理員" Or gstrUserType = "工程師" Then
frmUser.mblnAllowDelete = True
gstrCaoZuo = "刪除用戶"
Call WriteBlackBox
Else
Call Inform(33)
End If
Case "delete record"
If gstrUserType = "管理員" Then
frmDBManage.gblnHaveRightDelete = True
gstrCaoZuo = "刪除歷史數據庫"
Else
Call Inform(33)
frmDBManage.gblnHaveRightDelete = False
End If
Case "end"
gstrCaoZuo = "退出系統"
Call WriteBlackBox
End
End Select
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -