⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmlogin.vb

📁 这个是本人写的题库系统,开发工具是vb.net.试题编辑,试卷编辑,可以在word中编辑试题.由于时间关系,很多功能需要细化.
💻 VB
字号:
Public Class frmlogin
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 InitializeComponent() 调用之后添加任何初始化

    End Sub

    '窗体重写 dispose 以清理组件列表。
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意: 以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents Label1 As System.Windows.Forms.Label
    Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
    Friend WithEvents Label2 As System.Windows.Forms.Label
    Friend WithEvents Label3 As System.Windows.Forms.Label
    Friend WithEvents Label4 As System.Windows.Forms.Label
    Friend WithEvents txt_name As System.Windows.Forms.TextBox
    Friend WithEvents txt_pwd As System.Windows.Forms.TextBox
    Friend WithEvents comb_usertype As System.Windows.Forms.ComboBox
    Friend WithEvents cmd_ok As System.Windows.Forms.Button
    Friend WithEvents cmd_cancel As System.Windows.Forms.Button
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmlogin))
        Me.Label1 = New System.Windows.Forms.Label
        Me.GroupBox1 = New System.Windows.Forms.GroupBox
        Me.cmd_cancel = New System.Windows.Forms.Button
        Me.cmd_ok = New System.Windows.Forms.Button
        Me.comb_usertype = New System.Windows.Forms.ComboBox
        Me.txt_pwd = New System.Windows.Forms.TextBox
        Me.txt_name = New System.Windows.Forms.TextBox
        Me.Label4 = New System.Windows.Forms.Label
        Me.Label3 = New System.Windows.Forms.Label
        Me.Label2 = New System.Windows.Forms.Label
        Me.GroupBox1.SuspendLayout()
        Me.SuspendLayout()
        '
        'Label1
        '
        Me.Label1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
        Me.Label1.ForeColor = System.Drawing.Color.LightSeaGreen
        Me.Label1.Location = New System.Drawing.Point(8, 184)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(344, 16)
        Me.Label1.TabIndex = 0
        Me.Label1.Text = "翼清测试题库系统软件V1.0   联系:smq65@sohu.com  施明强"
        '
        'GroupBox1
        '
        Me.GroupBox1.Controls.Add(Me.cmd_cancel)
        Me.GroupBox1.Controls.Add(Me.cmd_ok)
        Me.GroupBox1.Controls.Add(Me.comb_usertype)
        Me.GroupBox1.Controls.Add(Me.txt_pwd)
        Me.GroupBox1.Controls.Add(Me.txt_name)
        Me.GroupBox1.Controls.Add(Me.Label4)
        Me.GroupBox1.Controls.Add(Me.Label3)
        Me.GroupBox1.Controls.Add(Me.Label2)
        Me.GroupBox1.Location = New System.Drawing.Point(48, 8)
        Me.GroupBox1.Name = "GroupBox1"
        Me.GroupBox1.Size = New System.Drawing.Size(272, 168)
        Me.GroupBox1.TabIndex = 1
        Me.GroupBox1.TabStop = False
        '
        'cmd_cancel
        '
        Me.cmd_cancel.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_cancel.Location = New System.Drawing.Point(152, 136)
        Me.cmd_cancel.Name = "cmd_cancel"
        Me.cmd_cancel.Size = New System.Drawing.Size(88, 24)
        Me.cmd_cancel.TabIndex = 7
        Me.cmd_cancel.Text = "取   消"
        '
        'cmd_ok
        '
        Me.cmd_ok.FlatStyle = System.Windows.Forms.FlatStyle.Flat
        Me.cmd_ok.Location = New System.Drawing.Point(40, 136)
        Me.cmd_ok.Name = "cmd_ok"
        Me.cmd_ok.Size = New System.Drawing.Size(88, 24)
        Me.cmd_ok.TabIndex = 6
        Me.cmd_ok.Text = "确   定"
        '
        'comb_usertype
        '
        Me.comb_usertype.CausesValidation = False
        Me.comb_usertype.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.comb_usertype.Items.AddRange(New Object() {"操作员", "系统管理员"})
        Me.comb_usertype.Location = New System.Drawing.Point(96, 104)
        Me.comb_usertype.Name = "comb_usertype"
        Me.comb_usertype.Size = New System.Drawing.Size(128, 20)
        Me.comb_usertype.TabIndex = 5
        '
        'txt_pwd
        '
        Me.txt_pwd.Location = New System.Drawing.Point(96, 70)
        Me.txt_pwd.MaxLength = 20
        Me.txt_pwd.Name = "txt_pwd"
        Me.txt_pwd.PasswordChar = Microsoft.VisualBasic.ChrW(42)
        Me.txt_pwd.Size = New System.Drawing.Size(128, 21)
        Me.txt_pwd.TabIndex = 4
        Me.txt_pwd.Text = ""
        '
        'txt_name
        '
        Me.txt_name.Location = New System.Drawing.Point(96, 32)
        Me.txt_name.MaxLength = 20
        Me.txt_name.Name = "txt_name"
        Me.txt_name.Size = New System.Drawing.Size(128, 21)
        Me.txt_name.TabIndex = 3
        Me.txt_name.Text = ""
        '
        'Label4
        '
        Me.Label4.Location = New System.Drawing.Point(24, 104)
        Me.Label4.Name = "Label4"
        Me.Label4.Size = New System.Drawing.Size(72, 16)
        Me.Label4.TabIndex = 2
        Me.Label4.Text = "用户类别:"
        '
        'Label3
        '
        Me.Label3.Location = New System.Drawing.Point(24, 72)
        Me.Label3.Name = "Label3"
        Me.Label3.Size = New System.Drawing.Size(56, 16)
        Me.Label3.TabIndex = 1
        Me.Label3.Text = "密  码:"
        '
        'Label2
        '
        Me.Label2.Location = New System.Drawing.Point(24, 40)
        Me.Label2.Name = "Label2"
        Me.Label2.Size = New System.Drawing.Size(56, 16)
        Me.Label2.TabIndex = 0
        Me.Label2.Text = "用户名:"
        '
        'frmlogin
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(368, 205)
        Me.Controls.Add(Me.GroupBox1)
        Me.Controls.Add(Me.Label1)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
        Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
        Me.MaximizeBox = False
        Me.Name = "frmlogin"
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "用户登陆"
        Me.GroupBox1.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub cmd_cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_cancel.Click
        Me.Close()
    End Sub

    Private Sub frmlogin_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        comb_usertype.SelectedIndex = 0
        LogInsuccess = False
        CurUser.Initials()
    End Sub

    Private Sub cmd_ok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmd_ok.Click
        If Trim(txt_name.Text) = "" Then
            MsgBox("用户名称不能为空", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_name.Focus()
            Exit Sub
        End If
        MyUser.UserName = MakeStr(txt_name.Text)
        If Trim(txt_pwd.Text) = "" Then
            MsgBox("密码不能为空", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_pwd.Focus()
            Exit Sub
        End If
        MyUser.UserPassWord = MakeStr(txt_pwd.Text)
        If Trim(comb_usertype.Text) = "" Then
            MsgBox("请选择用户类型", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_name.Focus()
            Exit Sub
        End If
        MyUser.UserType = MakeStr(comb_usertype.Text)
        If MyUser.CheckUser(MyUser.UserName, MyUser.UserType, MyUser.UserPassWord) = False Then
            MsgBox("您输入的用户名或密码或选择的用户类型不正确,请从新输入!", MsgBoxStyle.Exclamation, "翼清测试题库系统V1.0")
            txt_name.Text = ""
            txt_pwd.Text = ""
            LogInsuccess = False
            txt_name.Focus()
            Exit Sub
        End If
        CurUser.GetInfoByName(MyUser.UserName)
        LogInsuccess = True
        HaveLoadOp = True
        Me.Close()
    End Sub

    Private Sub cmd_ok_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cmd_ok.MouseMove
        cmd_ok.BackColor = System.Drawing.SystemColors.ControlLight
    End Sub

    Private Sub cmd_ok_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmd_ok.MouseLeave
        cmd_ok.BackColor = System.Drawing.SystemColors.Control
    End Sub

    Private Sub cmd_cancel_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmd_cancel.MouseLeave
        cmd_cancel.BackColor = System.Drawing.SystemColors.Control
    End Sub

    Private Sub cmd_cancel_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cmd_cancel.MouseMove
        cmd_cancel.BackColor = System.Drawing.SystemColors.ControlLight
    End Sub

    Private Sub txt_name_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt_name.KeyPress

    End Sub
End Class

⌨️ 快捷键说明

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