📄 frmlogin.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 3 'Fixed Dialog
Caption = "登录"
ClientHeight = 1590
ClientLeft = 45
ClientTop = 330
ClientWidth = 3750
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1590
ScaleWidth = 3750
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Tag = "登录"
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 3420
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 1260
Visible = 0 'False
Width = 1140
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 360
Left = 2100
TabIndex = 5
Tag = "取消"
Top = 1020
Width = 1140
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 360
Left = 495
TabIndex = 4
Tag = "确定"
Top = 1020
Width = 1140
End
Begin VB.TextBox txtPassword
Height = 270
IMEMode = 3 'DISABLE
Left = 1305
MaxLength = 6
PasswordChar = "*"
TabIndex = 1
Top = 525
Width = 2325
End
Begin VB.TextBox txtUserName
Height = 270
Left = 1305
MaxLength = 6
TabIndex = 3
Top = 120
Width = 2325
End
Begin VB.Label lblLabels
Caption = "密码(&P):"
Height = 248
Index = 1
Left = 105
TabIndex = 0
Tag = "密码(&P):"
Top = 540
Width = 1080
End
Begin VB.Label lblLabels
Caption = "用户名(&U):"
Height = 248
Index = 0
Left = 105
TabIndex = 2
Tag = "用户名(&U):"
Top = 150
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
Me.Data1.DatabaseName = App.Path & "\订单资料.MDB"
Me.Data1.RecordSource = " SELECT * FROM 单位信息"
Me.Data1.Refresh
If Data1.Recordset.RecordCount = 0 Then
Data1.Recordset.AddNew
Data1.Recordset.Update
End If
Data1.Recordset.MoveFirst
If Data1.Recordset("注册标记") = False Then
frm单位信息.Show 1
Me.Data1.Refresh
Me.Data1.Recordset.MoveFirst
End If
Data1.Refresh
hxfpiclj = Data1.Recordset("图编目录")
hxftplj = Data1.Recordset("图形目录")
hxfcjyhm = Data1.Recordset("超级用户名")
hxfcjyhkl = Data1.Recordset("超级用户口令")
txtUserName.Text = hxfcjyhm
End Sub
Private Sub cmdCancel_Click()
OK = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'ToDo: 创建测试密码是否正确
'检查正确密码
If Trim(txtPassword.Text) = Trim(hxfcjyhkl) 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 + -