www.pudn.com > zytgzgl.rar > frmlogin.frm, change:2004-06-17,size:6083b


VERSION 5.00 
Begin VB.Form frmlogin  
   Caption         =   "用户登录" 
   ClientHeight    =   5940 
   ClientLeft      =   60 
   ClientTop       =   450 
   ClientWidth     =   7155 
   LinkTopic       =   "Form1" 
   MaxButton       =   0   'False 
   MinButton       =   0   'False 
   ScaleHeight     =   5940 
   ScaleWidth      =   7155 
   StartUpPosition =   2  '屏幕中心 
   Begin VB.CommandButton cmdcancel  
      Caption         =   "取 消" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   3600 
      TabIndex        =   3 
      Top             =   4800 
      Width           =   1095 
   End 
   Begin VB.CommandButton cmdok  
      Caption         =   "确 定" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   495 
      Left            =   1800 
      TabIndex        =   2 
      Top             =   4800 
      Width           =   1095 
   End 
   Begin VB.TextBox password  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      IMEMode         =   3  'DISABLE 
      Left            =   3720 
      PasswordChar    =   "*" 
      TabIndex        =   1 
      Top             =   3720 
      Width           =   855 
   End 
   Begin VB.TextBox username  
      BeginProperty Font  
         Name            =   "宋体" 
         Size            =   12 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   375 
      Left            =   3720 
      TabIndex        =   0 
      Top             =   2520 
      Width           =   855 
   End 
   Begin VB.Label Label3  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "用户密码" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   14.25 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   285 
      Left            =   1680 
      TabIndex        =   6 
      Top             =   3720 
      Width           =   1260 
   End 
   Begin VB.Label Label2  
      AutoSize        =   -1  'True 
      BackColor       =   &H80000009& 
      BackStyle       =   0  'Transparent 
      Caption         =   "用户姓名" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   15 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   300 
      Left            =   1680 
      TabIndex        =   5 
      Top             =   2520 
      Width           =   1260 
   End 
   Begin VB.Label Label1  
      AutoSize        =   -1  'True 
      BackStyle       =   0  'Transparent 
      Caption         =   "企业工资管理系统" 
      BeginProperty Font  
         Name            =   "楷体_GB2312" 
         Size            =   21.75 
         Charset         =   134 
         Weight          =   700 
         Underline       =   0   'False 
         Italic          =   0   'False 
         Strikethrough   =   0   'False 
      EndProperty 
      Height          =   435 
      Left            =   1560 
      TabIndex        =   4 
      Top             =   720 
      Width           =   3720 
   End 
   Begin VB.Image Image1  
      Height          =   6015 
      Left            =   0 
      Picture         =   "frmlogin.frx":0000 
      Stretch         =   -1  'True 
      Top             =   0 
      Width           =   7215 
   End 
End 
Attribute VB_Name = "frmlogin" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
Dim pwdcount As Integer 
Private Sub cmdcancel_Click() 
  username.Text = "" 
  password.Text = "" 
End Sub 
Private Sub cmdok_Click() 
  Dim sql As String 
  Dim rs As ADODB.Recordset 
  If Trim(username.Text = "") Then 
    MsgBox "没有输入用户名称", vbOKOnly + vbExclamation, "警告" 
    username.SetFocus 
  Else 
    sql = "select * from userinfo where userid='" & username.Text & "'" 
    Set rs = getrs(sql, "salary") 
    If iflag = 1 Then 
    If rs.EOF = True Then 
       MsgBox "没有这个用户,请重新输入", vbOKOnly + vbExclamation, "警告" 
       username.SetFocus 
    Else 
       If Trim(rs.Fields(1)) = Trim(password.Text) Then 
       rs.Close 
       Me.Hide 
       strusername = Trim(username.Text) 
       userpassword = Trim(password.Text) 
       frmMain.Show 
       Unload Me 
      Else 
        MsgBox "密码不正确,请重新输入", vbOKOnly + vbExclamation, "警告" 
        password.SetFocus 
        password.Text = "" 
      End If 
    End If 
    End If 
  End If 
  pwdcount = pwdcount + 1 
  If pwdcount = 3 Then 
  Unload Me 
  End If 
End Sub 
Private Sub Form_Load() 
    pwdcount = 0 
    strusername = "" 
    userpassword = "" 
End Sub