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

📄 login.frm

📁 这是一个我帮师妹做的软件的大作业
💻 FRM
字号:
VERSION 5.00
Begin VB.Form login 
   BackColor       =   &H00FFC0C0&
   Caption         =   "CAUC学生信息管理系统"
   ClientHeight    =   2835
   ClientLeft      =   5370
   ClientTop       =   4545
   ClientWidth     =   4680
   DrawStyle       =   2  'Dot
   FillStyle       =   0  'Solid
   Icon            =   "login.frx":0000
   LinkTopic       =   "Form3"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2835
   ScaleWidth      =   4680
   Begin VB.Frame Frame2 
      BackColor       =   &H00FFC0C0&
      Height          =   1935
      Left            =   50
      TabIndex        =   0
      Top             =   840
      Width           =   4575
      Begin VB.CommandButton Command2 
         BackColor       =   &H00FFC0C0&
         Caption         =   "退出"
         Height          =   300
         Left            =   3360
         Style           =   1  'Graphical
         TabIndex        =   7
         Top             =   1560
         Width           =   855
      End
      Begin VB.CommandButton Command1 
         BackColor       =   &H00FFC0C0&
         Caption         =   "登录"
         Height          =   300
         Left            =   1920
         Style           =   1  'Graphical
         TabIndex        =   6
         Top             =   1560
         Width           =   855
      End
      Begin VB.Frame Frame1 
         Appearance      =   0  'Flat
         BackColor       =   &H00FFC0C0&
         ForeColor       =   &H80000008&
         Height          =   1215
         Left            =   120
         TabIndex        =   1
         Top             =   240
         Width           =   4335
         Begin VB.TextBox Text2 
            Appearance      =   0  'Flat
            BackColor       =   &H80000018&
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   350
            IMEMode         =   3  'DISABLE
            Left            =   1200
            PasswordChar    =   "*"
            TabIndex        =   3
            Top             =   720
            Width           =   1815
         End
         Begin VB.TextBox Text1 
            Appearance      =   0  'Flat
            BackColor       =   &H80000018&
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   10.5
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00000000&
            Height          =   350
            Left            =   1200
            TabIndex        =   2
            Top             =   240
            Width           =   1815
         End
         Begin VB.Label Label2 
            BackColor       =   &H00FFC0C0&
            Caption         =   "密码:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   255
            Left            =   345
            TabIndex        =   5
            Top             =   760
            Width           =   735
         End
         Begin VB.Label Label1 
            BackColor       =   &H00FFC0C0&
            Caption         =   "用户名:"
            BeginProperty Font 
               Name            =   "宋体"
               Size            =   12
               Charset         =   134
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            ForeColor       =   &H00C00000&
            Height          =   255
            Left            =   120
            TabIndex        =   4
            Top             =   300
            Width           =   975
         End
         Begin VB.Image Image2 
            Height          =   165
            Index           =   0
            Left            =   3360
            Picture         =   "login.frx":08CA
            Top             =   300
            Width           =   720
         End
         Begin VB.Image Image2 
            Height          =   165
            Index           =   1
            Left            =   3360
            Picture         =   "login.frx":0EFB
            Top             =   780
            Width           =   720
         End
      End
   End
   Begin VB.Image Image3 
      Height          =   855
      Left            =   0
      Picture         =   "login.frx":152C
      Stretch         =   -1  'True
      Top             =   0
      Width           =   4695
   End
End
Attribute VB_Name = "login"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Explode Me, 5000 ' open this form by number of desired increment
End Sub

Private Sub Command1_Click()
Dim mrc As ADODB.Recordset
txtSQL = "select * from use where username='" & Trim(Text1.Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = True Then
  MsgBox " 用户名错误!", vbExclamation + vbOKOnly, "警告"
  Text1.SetFocus
  Text1.SelStart = 0
  Text1.SelLength = Len(Text1.Text)
  Exit Sub
End If
user = mrc.Fields(0)
quanxian = mrc.Fields(2)
txtSQL = "select username from use where password='" & Trim(Text2.Text) & "'"
Set mrc = ExecuteSQL(txtSQL)
If mrc.EOF = True Then
  MsgBox " 密码错误!", vbExclamation + vbOKOnly, "警告"
  Text2.SetFocus
  Text2.SelStart = 0
  Text2.SelLength = Len(Text2.Text)
  Exit Sub
End If
If quanxian <> "管理员" Then
frmMain.Show
With frmMain

.AddScore.Enabled = False
.AddStudent.Enabled = False
.Adduser.Enabled = False
.Modifypwd.Enabled = False
.courseinfo.Enabled = False
.ModifyScore.Enabled = False
.ModifyStudent.Enabled = False
.fj.Enabled = False
'.transfertool.Enabled = False
End With
Else
frmMain.Show
End If


Unload Me

End Sub

Private Sub Command2_Click()
End
End Sub



Private Sub Form_Unload(Cancel As Integer)
frmMain.Enabled = True
End Sub

Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
  Text2.SetFocus
End If
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
 Command1.SetFocus
End If
End Sub

⌨️ 快捷键说明

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