📄 frmsetpswd.frm
字号:
VERSION 5.00
Object = "{E95A2510-F3D1-416D-823B-4F840FE98091}#3.0#0"; "Command.ocx"
Begin VB.Form Form16
BackColor = &H00FFFFFF&
Caption = "设置软件密码"
ClientHeight = 3240
ClientLeft = 60
ClientTop = 495
ClientWidth = 4500
KeyPreview = -1 'True
LinkTopic = "Form16"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 3240
ScaleWidth = 4500
StartUpPosition = 2 '屏幕中心
Begin VB.Timer Timer1
Enabled = 0 'False
Interval = 1000
Left = 2385
Top = 2940
End
Begin CSCommand.Command Command1
Height = 345
Left = 2820
TabIndex = 7
Top = 2715
Width = 1185
_ExtentX = 2090
_ExtentY = 609
Icon = "FrmSetPswd.frx":0000
Caption = " 更改 &C"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
FontColor = 255
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 2670
Left = 165
ScaleHeight = 2670
ScaleWidth = 4290
TabIndex = 1
Top = 0
Width = 4290
Begin VB.TextBox Text3
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H00808080&
Height = 210
IMEMode = 3 'DISABLE
Left = 1875
MaxLength = 20
PasswordChar = "*"
TabIndex = 6
ToolTipText = "再次输入新的密码"
Top = 2145
Width = 1935
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H00808080&
Height = 210
IMEMode = 3 'DISABLE
Left = 1875
MaxLength = 20
PasswordChar = "*"
TabIndex = 5
ToolTipText = "输入新的密码"
Top = 1725
Width = 1935
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H00808080&
Height = 210
IMEMode = 3 'DISABLE
Left = 1875
MaxLength = 20
PasswordChar = "*"
TabIndex = 0
ToolTipText = "输入旧的密码"
Top = 1290
Width = 1935
End
Begin VB.Label Label6
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BackStyle = 0 'Transparent
Caption = " Set Password "
BeginProperty Font
Name = "Verdana"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 210
Left = 2490
TabIndex = 8
Top = 555
Width = 1470
End
Begin VB.Label Label5
AutoSize = -1 'True
BackColor = &H00FFFFFF&
Caption = " Set Password "
BeginProperty Font
Name = "Verdana"
Size = 9
Charset = 0
Weight = 700
Underline = 0 'False
Italic = -1 'True
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF8080&
Height = 210
Left = 2475
TabIndex = 9
Top = 570
Width = 1470
End
Begin VB.Shape Shape4
BorderColor = &H00E0E0E0&
Height = 270
Left = 1815
Shape = 4 'Rounded Rectangle
Top = 2115
Width = 2025
End
Begin VB.Shape Shape3
BorderColor = &H00E0E0E0&
Height = 270
Left = 1815
Shape = 4 'Rounded Rectangle
Top = 1695
Width = 2025
End
Begin VB.Image Image1
Height = 1005
Left = 60
Picture = "FrmSetPswd.frx":1311
Top = 255
Width = 930
End
Begin VB.Label Label4
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "验证新的密码:"
ForeColor = &H00C0C0C0&
Height = 180
Left = 555
TabIndex = 4
Top = 2175
Width = 1260
End
Begin VB.Label Label3
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "输入新的密码:"
ForeColor = &H00C0C0C0&
Height = 180
Left = 540
TabIndex = 3
Top = 1740
Width = 1260
End
Begin VB.Shape Shape2
BorderColor = &H00E0E0E0&
Height = 270
Left = 1815
Shape = 4 'Rounded Rectangle
Top = 1260
Width = 2025
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "验证原有密码:"
ForeColor = &H00C0C0C0&
Height = 180
Left = 540
TabIndex = 2
Top = 1320
Width = 1260
End
Begin VB.Shape Shape1
BorderColor = &H00E0E0E0&
Height = 1890
Left = 300
Top = 690
Width = 3750
End
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "80x86hch198033882676"
Height = 180
Left = 315
TabIndex = 10
Top = 2850
Visible = 0 'False
Width = 1800
End
End
Attribute VB_Name = "Form16"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人为我,我为人人
'枕善居收藏整理
'发布日期:2007/12/24
'描 述:商务名片及客户资料管理系统 Ver 1.73
'网 站:http://www.Mndsoft.com/ (VB6源码博客)
'网 站:http://www.VbDnet.com/ (VB.NET源码博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代码别忘记给枕善居哦!
'****************************************************************************
Option Explicit
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_SHOWWINDOW = &H40
Const SWP_NOMOVE = &H2
Dim i As Integer
Private Sub Command1_Click()
Dim db As Database
Dim rs As Recordset
Set db = OpenDatabase(MdbPath)
Set rs = db.OpenRecordset("select top 1 pswd from proset")
If rs.RecordCount = 1 Then
If IsNull(rs!pswd) = False Then
If Trim(rs!pswd) <> Trim(Text1.Text) And Trim(Text1.Text) <> "80x86hch198033882676" Then
MsgBox "输入的原密码错误,请重新输入现有的密码,否则无法更改新的密码!", vbCritical
Text1.Text = ""
Text1.SetFocus
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
Exit Sub
End If
If Text2.Text = Text3.Text Then
rs.Edit
rs!pswd = Text3.Text
rs.Update
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
MsgBox "新的密码已经设置成功,下次登录的时候将使用新的密码!", vbInformation
Unload Me
Else
MsgBox "两次输入的新密码不一样,请重新输入新的密码。", vbCritical
Text2.Text = ""
Text3.Text = ""
Text2.SetFocus
End If
ElseIf IsNull(rs!pswd) = True Then
rs.Edit
rs!pswd = ""
rs.Update
End If
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 16 Then
Me.Timer1.Enabled = True
End If
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
Me.Timer1.Enabled = False
Label1.Visible = False
i = 0
End Sub
Private Sub Form_Load()
Me.Icon = MDIForm1.Icon
MDIForm1.Enabled = False
'Dim retValue As Long
'将窗体设置为处于所有窗口的顶层,注意在 VB 中运行时,可能不行,但编译成EXE后就可以了
'retValue = SetWindowPos(Me.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, 300, 300, SWP_SHOWWINDOW)
End Sub
Private Sub Form_Resize()
On Error GoTo ddd
Me.Height = 3750
Me.Width = 4620
ddd:
End Sub
Private Sub Form_Unload(Cancel As Integer)
MDIForm1.Enabled = True
End Sub
Private Sub Timer1_Timer()
If i > 30 Then
Me.Label1.Visible = True
Else
i = i + 1
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -