📄 frmloginchange.frm
字号:
VERSION 5.00
Begin VB.Form FrmLoginChange
BorderStyle = 3 'Fixed Dialog
Caption = "更改系统登陆用户"
ClientHeight = 1875
ClientLeft = 30
ClientTop = 330
ClientWidth = 3960
Icon = "FrmLoginChange.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1875
ScaleWidth = 3960
ShowInTaskbar = 0 'False
Begin VB.ComboBox Combo1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 330
Left = 1260
Style = 2 'Dropdown List
TabIndex = 3
Top = 252
Width = 2460
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 324
IMEMode = 3 'DISABLE
Left = 1260
MaxLength = 20
PasswordChar = "*"
TabIndex = 0
Top = 768
Width = 2460
End
Begin VB.CommandButton Command1
BackColor = &H00FFC0C0&
Caption = "确定(&O)"
Default = -1 'True
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 492
MaskColor = &H8000000F&
TabIndex = 1
Top = 1305
Width = 1425
End
Begin VB.CommandButton Command2
BackColor = &H00FFC0C0&
Caption = "退出(&X)"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 2016
TabIndex = 2
Top = 1305
Width = 1425
End
Begin VB.Label Label1
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "密 码:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Left = 180
TabIndex = 5
Top = 825
Width = 1050
End
Begin VB.Label Label2
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "登陆用户:"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 210
Left = 180
TabIndex = 4
Top = 300
Width = 1050
End
End
Attribute VB_Name = "FrmLoginChange"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim cn As New ADODB.Connection
Dim Rec As New ADODB.Recordset
Private Sub Combo1_Click()
On Error Resume Next
Text1.SetFocus
End Sub
Private Sub Command1_Click()
Dim TempPwd As String
Dim TempLgUser As String
TempPwd = MdlMain.ConVertPwd(Text1.Text)
TempLgUser = Trim(Left(Combo1.Text, InStr(Combo1.Text, " | ")))
Set Rec = cn.Execute("select * from loginuser where userbh='" & TempLgUser & "'")
If Rec.Fields("password").Value <> TempPwd Then
MsgBox "密码不正确,请重新输入...", vbOKOnly + vbInformation, "出错!"
TempPwd = ""
Text1.SetFocus
Exit Sub
End If
MdlMain.LoginBh = Trim(Left(Combo1.Text, InStr(Combo1.Text, " | ")))
MdlMain.LoginUser = Trim(Right(Combo1.Text, Len(Combo1.Text) - InStr(Combo1.Text, " | ") - 2))
MdlMain.Password = TempPwd
Rec.Close
Set Rec = Nothing
FrmMain.Caption = "布料管理系统(当前用户:" & MdlMain.LoginUser & ")"
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = vbKeyEscape Then Unload Me
End Sub
Private Sub Form_Load()
Me.Left = GetSetting(App.EXEName, "更改登陆用户", "left", (Screen.Width - Me.Width) / 2)
Me.Top = GetSetting(App.EXEName, "更改登陆用户", "top", (Screen.Height - Me.Height) / 2)
Me.KeyPreview = True
Text1.Text = ""
cn.Open DbLoginSql
Set Rec = cn.Execute("select * from loginuser order by userbh")
If Rec.EOF And Rec.BOF Then
cn.BeginTrans
Rec.AddNew
Rec.Fields("userbh").Value = "000"
Rec.Fields("username").Value = "supervistor"
Rec.Fields("password").Value = ConVertPwd("")
Rec.Update
cn.CommitTrans
Set Rec = cn.Execute("select * from loginuser")
End If
Rec.MoveFirst
Do While Not Rec.EOF
Combo1.AddItem Rec.Fields("userbh") & " | " & Rec.Fields("username")
Rec.MoveNext
Loop
Combo1.Text = Combo1.List(0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
SaveSetting App.EXEName, "更改登陆用户", "left", Me.Left
SaveSetting App.EXEName, "更改登陆用户", "top", Me.Top
On Error Resume Next
Rec.Close
Set Rec = Nothing
cn.Close
Set cn = Nothing
End Sub
Private Sub Text1_GotFocus()
Text1.Text = ""
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -