frmPWS.frm
上传用户:xiao_xia32
上传日期:2022-07-21
资源大小:1174k
文件大小:10k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0"; "THREED32.OCX"
  3. Begin VB.Form frmPWS 
  4.    BorderStyle     =   3  'Fixed Dialog
  5.    Caption         =   "口令修改"
  6.    ClientHeight    =   3135
  7.    ClientLeft      =   45
  8.    ClientTop       =   330
  9.    ClientWidth     =   5940
  10.    Icon            =   "frmPWS.frx":0000
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   3135
  16.    ScaleWidth      =   5940
  17.    ShowInTaskbar   =   0   'False
  18.    StartUpPosition =   2  '屏幕中心
  19.    Begin VB.Frame Frame2 
  20.       Height          =   2895
  21.       Left            =   4440
  22.       TabIndex        =   11
  23.       Top             =   120
  24.       Width           =   1335
  25.       Begin Threed.SSCommand cmdadd 
  26.          Height          =   495
  27.          Left            =   120
  28.          TabIndex        =   12
  29.          Top             =   360
  30.          Width           =   1095
  31.          _Version        =   65536
  32.          _ExtentX        =   1931
  33.          _ExtentY        =   873
  34.          _StockProps     =   78
  35.          Caption         =   "&A.确  定"
  36.       End
  37.       Begin Threed.SSCommand cmdexit 
  38.          Height          =   495
  39.          Left            =   120
  40.          TabIndex        =   13
  41.          Top             =   1080
  42.          Width           =   1095
  43.          _Version        =   65536
  44.          _ExtentX        =   1931
  45.          _ExtentY        =   873
  46.          _StockProps     =   78
  47.          Caption         =   "&Q.退 出"
  48.       End
  49.    End
  50.    Begin VB.Frame Frame1 
  51.       Height          =   2895
  52.       Left            =   120
  53.       TabIndex        =   3
  54.       Top             =   120
  55.       Width           =   4335
  56.       Begin VB.TextBox txtInfo 
  57.          Alignment       =   2  'Center
  58.          Appearance      =   0  'Flat
  59.          BeginProperty Font 
  60.             Name            =   "宋体"
  61.             Size            =   10.5
  62.             Charset         =   134
  63.             Weight          =   400
  64.             Underline       =   0   'False
  65.             Italic          =   0   'False
  66.             Strikethrough   =   0   'False
  67.          EndProperty
  68.          Height          =   325
  69.          IMEMode         =   3  'DISABLE
  70.          Index           =   4
  71.          Left            =   1320
  72.          PasswordChar    =   "*"
  73.          TabIndex        =   2
  74.          Top             =   2280
  75.          Width           =   2655
  76.       End
  77.       Begin VB.TextBox txtInfo 
  78.          Alignment       =   2  'Center
  79.          Appearance      =   0  'Flat
  80.          BeginProperty Font 
  81.             Name            =   "宋体"
  82.             Size            =   10.5
  83.             Charset         =   134
  84.             Weight          =   400
  85.             Underline       =   0   'False
  86.             Italic          =   0   'False
  87.             Strikethrough   =   0   'False
  88.          EndProperty
  89.          Height          =   325
  90.          Index           =   0
  91.          Left            =   1320
  92.          TabIndex        =   5
  93.          Top             =   360
  94.          Width           =   2655
  95.       End
  96.       Begin VB.TextBox txtInfo 
  97.          Alignment       =   2  'Center
  98.          Appearance      =   0  'Flat
  99.          BeginProperty Font 
  100.             Name            =   "宋体"
  101.             Size            =   10.5
  102.             Charset         =   134
  103.             Weight          =   400
  104.             Underline       =   0   'False
  105.             Italic          =   0   'False
  106.             Strikethrough   =   0   'False
  107.          EndProperty
  108.          Height          =   325
  109.          IMEMode         =   3  'DISABLE
  110.          Index           =   1
  111.          Left            =   1320
  112.          TabIndex        =   4
  113.          Top             =   840
  114.          Width           =   2655
  115.       End
  116.       Begin VB.TextBox txtInfo 
  117.          Alignment       =   2  'Center
  118.          Appearance      =   0  'Flat
  119.          BeginProperty Font 
  120.             Name            =   "宋体"
  121.             Size            =   10.5
  122.             Charset         =   134
  123.             Weight          =   400
  124.             Underline       =   0   'False
  125.             Italic          =   0   'False
  126.             Strikethrough   =   0   'False
  127.          EndProperty
  128.          Height          =   325
  129.          IMEMode         =   3  'DISABLE
  130.          Index           =   2
  131.          Left            =   1320
  132.          PasswordChar    =   "*"
  133.          TabIndex        =   0
  134.          Top             =   1320
  135.          Width           =   2655
  136.       End
  137.       Begin VB.TextBox txtInfo 
  138.          Alignment       =   2  'Center
  139.          Appearance      =   0  'Flat
  140.          BeginProperty Font 
  141.             Name            =   "宋体"
  142.             Size            =   10.5
  143.             Charset         =   134
  144.             Weight          =   400
  145.             Underline       =   0   'False
  146.             Italic          =   0   'False
  147.             Strikethrough   =   0   'False
  148.          EndProperty
  149.          Height          =   325
  150.          IMEMode         =   3  'DISABLE
  151.          Index           =   3
  152.          Left            =   1320
  153.          PasswordChar    =   "*"
  154.          TabIndex        =   1
  155.          Top             =   1800
  156.          Width           =   2655
  157.       End
  158.       Begin VB.Label Label1 
  159.          Caption         =   "用户代码"
  160.          Height          =   255
  161.          Index           =   0
  162.          Left            =   120
  163.          TabIndex        =   10
  164.          Top             =   395
  165.          Width           =   855
  166.       End
  167.       Begin VB.Label Label1 
  168.          Caption         =   "旧 口 令"
  169.          Height          =   255
  170.          Index           =   1
  171.          Left            =   120
  172.          TabIndex        =   9
  173.          Top             =   1355
  174.          Width           =   975
  175.       End
  176.       Begin VB.Label Label1 
  177.          Caption         =   "新 口 令"
  178.          Height          =   255
  179.          Index           =   2
  180.          Left            =   120
  181.          TabIndex        =   8
  182.          Top             =   1835
  183.          Width           =   975
  184.       End
  185.       Begin VB.Label Label1 
  186.          Caption         =   "新口令确认"
  187.          Height          =   255
  188.          Index           =   3
  189.          Left            =   120
  190.          TabIndex        =   7
  191.          Top             =   2415
  192.          Width           =   975
  193.       End
  194.       Begin VB.Label Label1 
  195.          Caption         =   "用 户 名"
  196.          Height          =   255
  197.          Index           =   4
  198.          Left            =   120
  199.          TabIndex        =   6
  200.          Top             =   875
  201.          Width           =   855
  202.       End
  203.    End
  204. End
  205. Attribute VB_Name = "frmPWS"
  206. Attribute VB_GlobalNameSpace = False
  207. Attribute VB_Creatable = False
  208. Attribute VB_PredeclaredId = True
  209. Attribute VB_Exposed = False
  210. Private Sub cmdadd_Click()
  211.     If Len(Me.txtInfo(3)) = 0 Or Len(Me.txtInfo(4)) = 0 Then
  212.         MsgBox "口令不能为空,请重新确认!", 48, "系统提示"
  213.         
  214.         With Me.txtInfo(3)
  215.             .SelStart = 0
  216.             .SelLength = Len(.Text)
  217.             .SetFocus
  218.         End With
  219.         Exit Sub
  220.     End If
  221.     
  222.     If Trim(Me.txtInfo(3)) <> Trim(Me.txtInfo(4)) Then
  223.         MsgBox "两次输入的新口令不相同,请检查!", 48, "系统提示"
  224.         
  225.         With Me.txtInfo(3)
  226.             .SelStart = 0
  227.             .SelLength = Len(.Text)
  228.             .SetFocus
  229.         End With
  230.         Exit Sub
  231.     End If
  232.     
  233.     If Trim(Me.txtInfo(2)) <> Trim(UserInfo.Pwd) Then
  234.         MsgBox "旧口令不对,请重新确认!", 48, "系统提示"
  235.         
  236.         With Me.txtInfo(2)
  237.             .SelStart = 0
  238.             .SelLength = Len(.Text)
  239.             .SetFocus
  240.         End With
  241.         Exit Sub
  242.     End If
  243.     sSQL = "update t_user set password='" & Trim(Me.txtInfo(3)) & "' where usercode='" & Trim(UserInfo.UserCode) & "'"
  244.         ConnWZ.Execute (sSQL)
  245.         MsgBox "修改口令成功,下次登录时生效!", 64, "系统提示"
  246.         Unload Me
  247. End Sub
  248. Private Sub cmdExit_Click()
  249.     Unload Me
  250. End Sub
  251. Private Sub Form_Load()
  252.     Me.txtInfo(0) = Trim(UserInfo.UserCode)
  253.     Me.txtInfo(1) = Trim(UserInfo.UserName)
  254.     Me.txtInfo(0).Enabled = False
  255.     Me.txtInfo(1).Enabled = False
  256. End Sub
  257. Private Sub txtInfo_KeyPress(Index As Integer, KeyAscii As Integer)
  258. If KeyAscii = vbKeyReturn Then
  259.     Select Case Index
  260.         Case 2
  261.             With Me.txtInfo(3)
  262.                 .SelStart = 0
  263.                 .SelLength = Len(.Text)
  264.                 .SetFocus
  265.             End With
  266.         Case 3
  267.             With Me.txtInfo(4)
  268.                 .SelStart = 0
  269.                 .SelLength = Len(.Text)
  270.                 .SetFocus
  271.             End With
  272.         Case 4
  273.             Me.cmdAdd.SetFocus
  274.     End Select
  275. End If
  276. End Sub
  277. Private Sub txtInfo_KeyUp(Index As Integer, KeyCode As Integer, Shift As Integer)
  278. Select Case Index
  279.     Case 2
  280.         If KeyCode = vbKeyRight Then
  281.             With Me.txtInfo(3)
  282.                 .SelStart = 0
  283.                 .SelLength = Len(.Text)
  284.                 .SetFocus
  285.             End With
  286.         End If
  287.     Case 3
  288.         If KeyCode = vbKeyRight Then
  289.             With Me.txtInfo(4)
  290.                 .SelStart = 0
  291.                 .SelLength = Len(.Text)
  292.                 .SetFocus
  293.             End With
  294.         End If
  295.         If KeyCode = vbKeyLeft Then
  296.             With Me.txtInfo(2)
  297.                 .SelStart = 0
  298.                 .SelLength = Len(.Text)
  299.                 .SetFocus
  300.             End With
  301.         End If
  302.     Case 4
  303.         If KeyCode = vbKeyLeft Then
  304.             With Me.txtInfo(3)
  305.                 .SelStart = 0
  306.                 .SelLength = Len(.Text)
  307.                 .SetFocus
  308.             End With
  309.         End If
  310.         If KeyCode = vbKeyRight Then
  311.             Me.cmdAdd.SetFocus
  312.         End If
  313. End Select
  314. End Sub