www.pudn.com > opy_LMS.rar > frmAdmin.frm


VERSION 5.00 
Begin VB.Form frmAdmin  
   BorderStyle     =   1  'Fixed Single 
   Caption         =   "管理员密码" 
   ClientHeight    =   3210 
   ClientLeft      =   45 
   ClientTop       =   330 
   ClientWidth     =   5070 
   ControlBox      =   0   'False 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   3210 
   ScaleWidth      =   5070 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton cmdCancel  
      Cancel          =   -1  'True 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   615 
      Left            =   3840 
      MouseIcon       =   "frmAdmin.frx":0000 
      MousePointer    =   99  'Custom 
      Picture         =   "frmAdmin.frx":0152 
      Style           =   1  'Graphical 
      TabIndex        =   1 
      ToolTipText     =   "取消" 
      Top             =   2280 
      Width           =   1020 
   End 
   Begin VB.CommandButton cmdOK  
      Default         =   -1  'True 
      BeginProperty Font  
         Name            =   "MS Sans Serif" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   615 
      Left            =   2640 
      MouseIcon       =   "frmAdmin.frx":06D2 
      MousePointer    =   99  'Custom 
      Picture         =   "frmAdmin.frx":0824 
      Style           =   1  'Graphical 
      TabIndex        =   0 
      ToolTipText     =   "点击登入" 
      Top             =   2280 
      Width           =   1020 
   End 
   Begin VB.Frame Frame1  
      Height          =   1215 
      Left            =   120 
      TabIndex        =   6 
      Top             =   960 
      Width           =   4815 
      Begin VB.TextBox txt_pass1  
         BeginProperty Font  
            Name            =   "MS Sans Serif" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00400000& 
         Height          =   345 
         IMEMode         =   3  'DISABLE 
         Left            =   2040 
         MaxLength       =   20 
         PasswordChar    =   "*" 
         TabIndex        =   3 
         ToolTipText     =   "管理员密码" 
         Top             =   240 
         Width           =   2685 
      End 
      Begin VB.TextBox txt_pass2  
         BeginProperty Font  
            Name            =   "MS Sans Serif" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00400000& 
         Height          =   345 
         IMEMode         =   3  'DISABLE 
         Left            =   2040 
         MaxLength       =   20 
         PasswordChar    =   "*" 
         TabIndex        =   4 
         ToolTipText     =   "管理员密码确认" 
         Top             =   720 
         Width           =   2685 
      End 
      Begin VB.Label lbl_pass1  
         BackStyle       =   0  'Transparent 
         Caption         =   "密   码" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00800000& 
         Height          =   270 
         Index           =   0 
         Left            =   120 
         TabIndex        =   8 
         Top             =   240 
         Width           =   1080 
      End 
      Begin VB.Label lbl_pass2  
         BackStyle       =   0  'Transparent 
         Caption         =   "密码确认" 
         BeginProperty Font  
            Name            =   "宋体" 
            Size            =   9.75 
            Charset         =   0 
            Weight          =   700 
            Underline       =   0   'False 
            Italic          =   0   'False 
            Strikethrough   =   0   'False 
         EndProperty 
         ForeColor       =   &H00800000& 
         Height          =   270 
         Index           =   1 
         Left            =   120 
         TabIndex        =   10 
         Top             =   720 
         Width           =   1680 
      End 
   End 
   Begin VB.Label Label2  
      Alignment       =   2  'Center 
      BackStyle       =   0  'Transparent 
      Caption         =   "取消" 
      Height          =   255 
      Left            =   3840 
      TabIndex        =   9 
      Top             =   3000 
      Width           =   975 
   End 
   Begin VB.Label Label1  
      Alignment       =   2  'Center 
      BackStyle       =   0  'Transparent 
      Caption         =   "确定" 
      Height          =   255 
      Left            =   2640 
      TabIndex        =   7 
      Top             =   3000 
      Width           =   975 
   End 
   Begin VB.Label Label3  
      BackStyle       =   0  'Transparent 
      Caption         =   "注 : 管理员能在""管理员设置""对话框处修改密码" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   615 
      Left            =   120 
      TabIndex        =   5 
      Top             =   2400 
      Width           =   2295 
   End 
   Begin VB.Label lbl_admin  
      BackStyle       =   0  'Transparent 
      Caption         =   "输入管理员密码,这个密码能作为管理员登录!" 
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   9.75 
         Charset         =   0 
         Weight          =   400 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      ForeColor       =   &H00000000& 
      Height          =   615 
      Left            =   1440 
      TabIndex        =   2 
      Top             =   240 
      Width           =   3375 
   End 
   Begin VB.Image Image1  
      Height          =   900 
      Left            =   240 
      Picture         =   "frmAdmin.frx":0D96 
      Top             =   120 
      Width           =   1020 
   End 
End 
Attribute VB_Name = "frmadmin" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Dim str As String 
Dim Adconnnection As ADODB.Connection 
Private Sub cmdCancel_Click() 
Me.Hide 
Unload Me 
End Sub 
Private Sub cmdOK_Click() 
If txt_pass1.Text = "" Then 
MsgBox "请输入密码!", vbInformation, "密码错误" 
ElseIf txt_pass2.Text = "" Then 
MsgBox "请输入密码确认!", vbInformation, "密码错误" 
ElseIf txt_pass1.Text <> txt_pass2.Text Then 
MsgBox "密码不一致!", vbInformation, "密码错误" 
txt_pass1.Text = "" 
txt_pass2.Text = "" 
txt_pass1.SetFocus 
Else 
    If MsgBox("这个密码作为管理员权限安全,你确定要保存这个密码 ?", vbYesNo + vbExclamation, "信息提示") = vbYes Then 
     str = "UPDATE Custom SET Pass='" & Trim(txt_pass1.Text) & "'" 
    Adconnnection.Execute str 
    MsgBox "管理员能在菜单 系统管理/系统设置 设置.", vbInformation, "管理员设置" 
    Call globalload 
    DoEvents 
    Me.Hide 
    Unload Me 
    Exit Sub 
    Else 
    txt_pass1.Text = "" 
    txt_pass2.Text = "" 
    txt_pass1.SetFocus 
    Exit Sub 
    End If 
End If 
End Sub 
 
Private Sub Form_Load() 
On Error GoTo errlable 
  Set Adconnnection = New ADODB.Connection 
  Adconnnection.ConnectionString = "DSN=library;UID=sa;PWD=;" 
  Adconnnection.Open 
Exit Sub 
errlable: 
MsgBox Err.Description & Err.Number 
End Sub 
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) 
  Call endata(KeyAscii) 
End Sub