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

📄 frmlogin.frm

📁 网上销售源代码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmLogin 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "登录"
   ClientHeight    =   2550
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6075
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2550
   ScaleWidth      =   6075
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Tag             =   "1056"
   Begin VB.CommandButton cmdCancel 
      Cancel          =   -1  'True
      Caption         =   "取消"
      Height          =   480
      Left            =   3090
      TabIndex        =   5
      Tag             =   "1060"
      Top             =   1710
      Width           =   1170
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定"
      Default         =   -1  'True
      Height          =   480
      Left            =   1500
      TabIndex        =   4
      Tag             =   "1059"
      Top             =   1740
      Width           =   1170
   End
   Begin VB.TextBox txtPassword 
      Height          =   420
      IMEMode         =   3  'DISABLE
      Left            =   2115
      PasswordChar    =   "*"
      TabIndex        =   1
      Top             =   1110
      Width           =   2535
   End
   Begin VB.TextBox txtUserName 
      Height          =   420
      Left            =   2115
      TabIndex        =   3
      Top             =   555
      Width           =   2535
   End
   Begin VB.Label lblLabels 
      Caption         =   "密码(&P):"
      Height          =   255
      Index           =   1
      Left            =   885
      TabIndex        =   0
      Tag             =   "1058"
      Top             =   1200
      Width           =   1080
   End
   Begin VB.Label lblLabels 
      Caption         =   "用户名(&U):"
      Height          =   255
      Index           =   0
      Left            =   915
      TabIndex        =   2
      Tag             =   "1057"
      Top             =   630
      Width           =   1080
   End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long

Public OK As Boolean

Private Sub Form_Load()
    Dim sBuffer As String
    Dim lSize As Long
    
    LoadResStrings Me

    sBuffer = Space$(255)
    lSize = Len(sBuffer)
    Call GetUserName(sBuffer, lSize)
    If lSize > 0 Then
        txtUserName.Text = Left$(sBuffer, lSize)
    Else
        txtUserName.Text = vbNullString
    End If
End Sub



Private Sub cmdCancel_Click()
    OK = False
    Me.Hide
End Sub


Private Sub cmdOK_Click()
    'ToDo: 创建测试密码是否正确
    '检查正确密码
    
    '连接数据库
    StatDB
    
    If txtPassword.Text = "" Then
        OK = True
        Me.Hide
    Else
        MsgBox "密码错误,再试一次!", , "登录"
        txtPassword.SetFocus
        txtPassword.SelStart = 0
        txtPassword.SelLength = Len(txtPassword.Text)
    End If
End Sub

⌨️ 快捷键说明

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