📄 passform.frm
字号:
Width = 1965
End
Begin VB.CommandButton Csure
Caption = "确 认"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 7980
TabIndex = 4
Top = 1050
Width = 1965
End
Begin VB.CommandButton Cchange
Caption = "修改密码"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 7980
TabIndex = 3
Top = 2640
Width = 1965
End
Begin VB.CommandButton Cset
Caption = "模块配置"
Enabled = 0 'False
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 975
Left = 7980
TabIndex = 2
Top = 4200
Width = 1965
End
End
Begin VB.Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "请输入密码:"
BeginProperty Font
Name = "宋体"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 900
TabIndex = 20
Top = 750
Width = 2655
End
Begin VB.Label Label2
BackStyle = 0 'Transparent
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00C000C0&
Height = 465
Left = 7740
TabIndex = 19
Top = 750
Width = 4965
End
End
Begin VB.Label Label12
BackStyle = 0 'Transparent
Caption = "节水灌溉智能监控系统"
BeginProperty Font
Name = "宋体"
Size = 26.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000080FF&
Height = 540
Left = 4320
TabIndex = 29
Top = 210
Width = 7545
End
End
Attribute VB_Name = "PassForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim password As String
Dim passlengh As Integer
Dim password0 As String
Dim passfile As String
Private Sub Form_Load()
Label1.Caption = "请输入密码:"
Label2.Caption = ""
passwordText.Text = ""
password = ""
passlengh = 0
Call openpassword
End Sub
Private Sub openpassword()
On Error GoTo errhandler
Dim opendata(10) As String
f% = FreeFile
passfile = App.Path & "\data\password.txt"
'passfile = WinDir & "\" & "\system32" & "\" & "password.txt"
Open passfile For Input As #f%
Do
Input #f%, opendata(i)
i = i + 1
Loop Until EOF(f%)
Close #f%
password0 = opendata(0)
Exit Sub
errhandler:
password0 = "000000"
Exit Sub
End Sub
Private Sub C0_Click()
password = password + "0"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c1_Click()
password = password + "1"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c2_Click()
password = password + "2"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c3_Click()
password = password + "3"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c4_Click()
password = password + "4"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c5_Click()
password = password + "5"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub c6_Click()
password = password + "6"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub C7_Click()
password = password + "7"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub C8_Click()
password = password + "8"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub C9_Click()
password = password + "9"
passlengh = passlengh + 1
passwordText.Text = password
Label2.Caption = ""
End Sub
Private Sub Cback_Click()
If passlengh > 0 Then
passlengh = passlengh - 1
End If
password = Left$(password, passlengh)
passwordText.Text = password
End Sub
Private Sub Cclear_Click()
passwordText.Text = ""
password = ""
passlengh = 0
End Sub
Private Sub Cchange_Click()
Label1.Caption = "请输入新密码:"
Label2.Caption = ""
passwordText.Text = ""
password = ""
passlengh = 0
commandbz = 4
End Sub
Private Sub Cset_Click()
Label1.Caption = "请输入密码:"
Label2.Caption = ""
passwordText.Text = ""
password = ""
passlengh = 0
commandbz = 5
End Sub
Private Sub Csure_Click()
If (commandbz = 1 Or commandbz = 3 Or commandbz = 6) Then
If passwordText.Text = password0 Then
Label2.Caption = "(密码输入正确!)"
If (commandbz = 1) Then
TeamForm.Frame1.Enabled = True
TeamForm.Frame2.Enabled = True
TeamForm.Cmdload.Enabled = True
TeamForm.Cmdsave.Enabled = True
TeamForm.Cmdnew.Enabled = True
TeamForm.Cmdsure.Enabled = True
TeamForm.Cmdtime.Enabled = True
TeamForm.timeText.Enabled = True
Cchange.Enabled = True
Cset.Enabled = True
TeamForm.Timer1.Enabled = False
TeamForm.Cmdstart.Enabled = False
Unload PassForm
End If
If (commandbz = 6) Then
Unload PassForm
TeamForm2.Show
End If
If (commandbz = 3) Then
ppp = MsgBox("你确信要退出吗?", 65, "特别提示")
If (ppp = 1) Then
Call open_all '打开所有继电器
Call CAN_Close(mindex) '关闭设备
Unload CANform
Unload dingweiForm
Unload drawForm
Unload filedForm
Unload GuideForm
Unload HisForm
Unload HisForm2
Unload setForm
Unload TeamForm
Unload TeamForm2
Unload xxForm
Unload PassForm
End
Else
Unload PassForm
filedForm.Show
Exit Sub
End If
End If
Else
Label2.Caption = "(密码不正确,请重新输入!)"
passwordText.Text = ""
password = ""
passlengh = 0
End If
End If
If (commandbz = 2) Then
If passwordText.Text = "1" Then
Label2.Caption = "(密码输入正确,可以进行系统设置!)"
Cchange.Enabled = True
Cset.Enabled = True
Else
Label2.Caption = "(密码不正确,请重新输入!)"
passwordText.Text = ""
password = ""
passlengh = 0
End If
End If
If commandbz = 4 Then
ch$ = Chr(13) + Chr(10)
msg1$ = "系统登录密码被修改为:" & password & " "
msg2$ = "你确认密码修改吗?"
msg$ = msg1$ + ch$ + msg2$
ppp = MsgBox(msg$, 65, "特别提示")
If (ppp = 1) Then
password0 = password
Close
F3 = FreeFile
Open passfile For Output As #F3
Print #F3, password
Close #F3
Unload PassForm
filedForm.Show
End If
End If
If (commandbz = 5) Then
If passwordText.Text = "1" Then
Label2.Caption = "(密码输入正确,可以进行阀门编址!)"
Unload PassForm
setForm.Show
Else
Label2.Caption = "(密码不正确,请重新输入!)"
passwordText.Text = ""
password = ""
passlengh = 0
End If
End If
End Sub
Private Sub Cmdbz_Click()
TeamForm.Show
End Sub
Private Sub Cmdzt_Click()
filedForm.Show
End Sub
Private Sub Cmdxx_Click()
xxForm.Show
End Sub
Private Sub Cdata_Click()
HisForm.Show
Call HisForm.get_cdata
End Sub
Private Sub Cmdset_Click()
commandbz = 2
PassForm.Show
End Sub
Private Sub Cmdzn_Click()
GuideForm.Show
End Sub
Private Sub Cmdquit_Click()
commandbz = 3
PassForm.Show
End Sub
Private Sub Cclose_Click()
Unload Me
filedForm.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -