formzhuce.frm

来自「企业员工信息管理系统.可以对企业的员工的各种信息进行管理」· FRM 代码 · 共 354 行

FRM
354
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form新用户注册 
   Caption         =   "新用户注册"
   ClientHeight    =   5580
   ClientLeft      =   3735
   ClientTop       =   2730
   ClientWidth     =   7740
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   Picture         =   "Formzhuce.frx":0000
   ScaleHeight     =   5580
   ScaleWidth      =   7740
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton Command3 
      BackColor       =   &H00FFFFC0&
      Caption         =   "返回"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   3960
      Style           =   1  'Graphical
      TabIndex        =   9
      Top             =   4680
      Width           =   1335
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   495
      Left            =   0
      Top             =   4680
      Visible         =   0   'False
      Width           =   1935
      _ExtentX        =   3413
      _ExtentY        =   873
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   2
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=employer;Data Source=(local)"
      OLEDBString     =   "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=employer;Data Source=(local)"
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   "usermessege"
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin VB.CommandButton Command2 
      BackColor       =   &H00FFFFC0&
      Caption         =   "取  消"
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   5640
      Style           =   1  'Graphical
      TabIndex        =   8
      Top             =   4680
      Width           =   1335
   End
   Begin VB.CommandButton Command1 
      BackColor       =   &H00FFFFC0&
      Caption         =   "确  定"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "华文行楷"
         Size            =   14.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   2280
      Style           =   1  'Graphical
      TabIndex        =   7
      Top             =   4680
      Width           =   1335
   End
   Begin VB.TextBox Text3 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3000
      PasswordChar    =   "*"
      TabIndex        =   6
      Top             =   3480
      Width           =   2895
   End
   Begin VB.TextBox Text2 
      Height          =   495
      IMEMode         =   3  'DISABLE
      Left            =   3000
      PasswordChar    =   "*"
      TabIndex        =   5
      Top             =   2760
      Width           =   2895
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   3000
      TabIndex        =   2
      Top             =   2040
      Width           =   2895
   End
   Begin VB.Label Label6 
      BackStyle       =   0  'Transparent
      Caption         =   "(6-16位)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   6000
      TabIndex        =   11
      Top             =   2880
      Width           =   1455
   End
   Begin VB.Label Label5 
      BackStyle       =   0  'Transparent
      Caption         =   "(3-8位)"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   12
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   6000
      TabIndex        =   10
      Top             =   2160
      Width           =   1455
   End
   Begin VB.Label Label4 
      BackStyle       =   0  'Transparent
      Caption         =   "请确认密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   375
      Left            =   1440
      TabIndex        =   4
      Top             =   3600
      Width           =   1575
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "请输入密码:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   375
      Left            =   1440
      TabIndex        =   3
      Top             =   2880
      Width           =   1455
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "请输入用户名:"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   10.5
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   375
      Left            =   1440
      TabIndex        =   1
      Top             =   2160
      Width           =   1575
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "新用户注册"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   48
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0080FF80&
      Height          =   1095
      Left            =   1320
      TabIndex        =   0
      Top             =   360
      Width           =   5055
   End
End
Attribute VB_Name = "Form新用户注册"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command1_Click()
'判断用户名是否为空
If Len(Text1.Text) = 0 Then
  MsgBox "用户名不能为空,请输入用户名!", vbOKOnly + vbExclamation, "警告"
  Text1.SetFocus
  Exit Sub
End If

'限制用户名长度
If Len(Trim(Text1.Text)) < 3 Or Len(Trim(Text1.Text)) > 8 Then
 MsgBox "用户名必须为3-8位!", vbOKOnly + vbExclamation, "警告"
 Text1.Text = ""
 Text2.Text = ""
 Text3.Text = ""
 Text1.SetFocus
 Exit Sub
End If

'判断用户名是否存在
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from usermessege where Uname='" & Trim(Text1.Text) & "'"
    Adodc1.Refresh
    If Adodc1.Recordset.EOF = False Then
       MsgBox "用户名已经存在,请重新输入!", vbOKOnly + vbExclamation, "警告"
       Text1.Text = ""
       Text2.Text = ""
       Text3.Text = ""
       Text1.SetFocus
       Exit Sub
    End If

'判断密码是否为空
If Trim(Text2.Text) = "" Then
     MsgBox "密码不能为空,请输入密码", vbOKOnly + vbExclamation, "警告"
      Text3.Text = ""
      Text2.SetFocus
      Exit Sub
 End If
 
'限制密码长度
If Len(Trim(Text2.Text)) < 6 Or Len(Trim(Text2.Text)) > 16 Then
 MsgBox "密码必须为6-16位!", vbOKOnly + vbExclamation, "警告"
 Text2.Text = ""
 Text3.Text = ""
 Text2.SetFocus
 Exit Sub
End If

 '判断重复密码是否为空
 If Trim(Text3.Text) = "" Then
    MsgBox "请再次输入密码", vbOKOnly + vbExclamation, "警告"
    Text3.SetFocus
    Exit Sub
 End If
 
'判断两次所输入的密码是否一致
If Text2.Text <> Text3.Text Then
        MsgBox "输入密码不一致,请重新输入", vbOKOnly + vbExclamation, "警告"
        Text2.Text = ""
        Text3.Text = ""
        Text2.SetFocus
        Exit Sub
End If

'把数据输入数据库
    Adodc1.Recordset.AddNew
    Adodc1.Recordset.Fields("Uname").Value = Trim(Text1.Text)
    Adodc1.Recordset.Fields("Upassword").Value = Trim(Text2.Text)
    Adodc1.Recordset.Fields("Utype").Value = "普通用户"
    Adodc1.Recordset.Update
    Adodc1.Refresh
    MsgBox "恭喜你!注册成功!"
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Form用户登录.Show
    Me.Hide
     

End Sub

Private Sub Command2_Click()
End
End Sub

Private Sub Command3_Click()
Form用户登录.Show
Me.Hide
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?