Form_Edit.frm
资源名称:ERPSYS.zip [点击查看]
上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:4k
源码类别:
企业管理
开发平台:
Visual Basic
- VERSION 5.00
- Begin VB.Form Frm_Password
- BorderStyle = 1 'Fixed Single
- Caption = "修改口令"
- ClientHeight = 1530
- ClientLeft = 3930
- ClientTop = 3015
- ClientWidth = 4050
- Icon = "Form_Edit.frx":0000
- LinkTopic = "Form1"
- LockControls = -1 'True
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1530
- ScaleWidth = 4050
- StartUpPosition = 2 '屏幕中心
- Begin VB.CommandButton Command1
- Caption = "取消&C"
- Height = 315
- Index = 1
- Left = 2310
- TabIndex = 5
- Top = 1020
- Width = 1155
- End
- Begin VB.CommandButton Command1
- Caption = "确定&D"
- Height = 315
- Index = 0
- Left = 600
- TabIndex = 4
- Top = 1020
- Width = 1155
- End
- Begin VB.TextBox Text1
- Height = 285
- IMEMode = 3 'DISABLE
- Index = 1
- Left = 1320
- PasswordChar = "*"
- TabIndex = 3
- Top = 600
- Width = 2055
- End
- Begin VB.TextBox Text1
- Height = 285
- IMEMode = 3 'DISABLE
- Index = 0
- Left = 1320
- PasswordChar = "*"
- TabIndex = 2
- Top = 210
- Width = 2055
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "新口令"
- Height = 180
- Index = 1
- Left = 330
- TabIndex = 1
- Top = 660
- Width = 540
- End
- Begin VB.Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "旧口令"
- Height = 180
- Index = 0
- Left = 330
- TabIndex = 0
- Top = 240
- Width = 540
- End
- End
- Attribute VB_Name = "Frm_Password"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub Command1_Click(Index As Integer)
- On Error Resume Next
- Dim aDo_Password As New Recordset
- If Index = 1 Then Unload Me: Exit Sub
- Set aDo_Password = Conn_System.Execute("select * from HDSystem_Password")
- If aDo_Password.RecordCount > 0 Then
- If Mmjm1(Trim(Text1(0).Text)) <> Trim(aDo_Password!Password) Then MsgBox "旧口令错误! ", 16: aDo_Password.Close: Text1(0).SetFocus: Exit Sub
- Conn_System.Execute "update HDSystem_Password set Password='" & Mmjm1(Trim(Text1(1).Text)) & "'"
- Else
- If Trim(Text1(0).Text) <> "" Then MsgBox "旧口令错误! ", 16: aDo_Password.Close: Text1(0).SetFocus: Exit Sub
- Conn_System.Execute "insert into HDSystem_Password(Id,Password)VALUES(1,'" & Mmjm1(Trim(Text1(1).Text)) & "')"
- End If
- aDo_Password.Close
- Set aDo_Password = Nothing
- MsgBox "口令修改成功! ", 48
- Unload Me
- If Err <> 0 Then
- MsgBox Err.Description, 16
- End If
- End Sub
- Private Function Mmjm1(Srmm As String) As String '密码加密模块
- Dim Zfcte As Integer
- Mmjm1 = ""
- For jsqte = 1 To Len(Srmm)
- Zfcte = Asc(Mid(Srmm, jsqte, 1)) + Len(Srmm) + jsqte
- Mmjm1 = Mmjm1 + Mid(Trim(str(1000 + Zfcte)), 2, 3)
- Next jsqte
- End Function