📄 frmlogin.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{CE671F01-259E-40DA-92FE-95803E2ECBB5}#1.0#0"; "SMARTXPBUTTON.OCX"
Begin VB.Form FrmLogin
AutoRedraw = -1 'True
BackColor = &H00E0E0E0&
BorderStyle = 1 'Fixed Single
Caption = "水费卫生费管理系统"
ClientHeight = 2775
ClientLeft = 30
ClientTop = 330
ClientWidth = 3900
ControlBox = 0 'False
Icon = "FrmLogin.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2775
ScaleWidth = 3900
StartUpPosition = 3 '窗口缺省
Begin VB.ComboBox Combo1
BackColor = &H00DFFFF8&
ForeColor = &H00000000&
Height = 300
Left = 1380
Style = 2 'Dropdown List
TabIndex = 0
Top = 1200
Width = 2100
End
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00DFFFF8&
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 330
IMEMode = 3 'DISABLE
Left = 1380
MaxLength = 20
PasswordChar = "*"
TabIndex = 1
Top = 1695
Width = 2100
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
AutoSize = -1 'True
BorderStyle = 0 'None
Height = 1065
Left = -1560
Picture = "FrmLogin.frx":08CA
ScaleHeight = 1065
ScaleWidth = 1545
TabIndex = 5
Top = 1575
Width = 1545
End
Begin MSComCtl2.DTPicker DTPicker1
Height = 330
Left = 1380
TabIndex = 2
Top = 720
Width = 2100
_ExtentX = 3704
_ExtentY = 582
_Version = 393216
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
CalendarForeColor= 0
CalendarTitleForeColor= 0
Format = 24641536
CurrentDate = 37119
End
Begin SmartXPButton.XpButton Command1
Default = -1 'True
Height = 390
Left = 465
TabIndex = 3
Top = 2250
Width = 1125
_ExtentX = 1984
_ExtentY = 688
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "确定(&O)"
PictureSmoothBackColor= 13882323
ButtonPicture = "FrmLogin.frx":1851
End
Begin SmartXPButton.XpButton Command2
Height = 390
Left = 2325
TabIndex = 4
Top = 2250
Width = 1125
_ExtentX = 1984
_ExtentY = 688
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出(&X)"
PictureSmoothBackColor= 13882323
ButtonPicture = "FrmLogin.frx":19AB
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 = 375
TabIndex = 8
Top = 1740
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 = 375
TabIndex = 7
Top = 1245
Width = 1050
End
Begin VB.Label Label3
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 = 375
TabIndex = 6
Top = 765
Width = 1050
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "登陆日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 240
Index = 1
Left = 405
TabIndex = 10
Top = 150
Width = 1200
End
Begin VB.Label Label4
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BackStyle = 0 'Transparent
Caption = "登陆日期:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 240
Index = 0
Left = 390
TabIndex = 9
Top = 135
Width = 1200
End
Begin VB.Shape Shape1
BorderStyle = 0 'Transparent
FillColor = &H00A56E3A&
FillStyle = 0 'Solid
Height = 630
Left = -60
Top = -75
Width = 4095
End
End
Attribute VB_Name = "FrmLogin"
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()
Text1.SetFocus
End Sub
Private Sub Command1_Click()
MdlMain.Password = MdlMain.ConVertPwd(Text1.Text)
MdlMain.LoginBh = Trim(Left(Combo1.Text, InStr(Combo1.Text, " | ")))
MdlMain.LoginUser = Trim(Right(Combo1.Text, Len(Combo1.Text) - InStr(Combo1.Text, " | ") - 2))
MdlMain.LoginTime.LgNow = DTPicker1.Value
MdlMain.LoginTime.LgTime = Format(DTPicker1.Value, "yyyy-mm-dd")
MdlMain.LoginTime.LgDate = Day(DTPicker1.Value)
MdlMain.LoginTime.LgMonth = Month(DTPicker1.Value)
MdlMain.LoginTime.LgYear = Year(DTPicker1.Value)
Set Rec = cn.Execute("select * from loginuser where userbh='" & MdlMain.LoginBh & "'")
If Rec.Fields("password").Value <> MdlMain.Password Then
MsgBox "密码不正确,请重新输入...", vbOKOnly + vbInformation, "出错!"
Rec.Close: Set Rec = Nothing
MdlMain.Password = ""
Text1.SetFocus
Exit Sub
End If
Rec.Close: Set Rec = Nothing
Rec.CursorLocation = adUseClient
Rec.Open "select loginwarrant.*,logingn.gnname from loginwarrant,logingn where " & _
"logingn.bh=loginwarrant.bh and left(loginwarrant.bh,1)<>'^' and " & _
"loginwarrant.[userbh]='" & MdlMain.LoginBh & "'", cn, adOpenDynamic, adLockOptimistic
ReDim MdlMain.LoginQx(0)
If Not Rec.EOF And Not Rec.BOF Then
Do While Not Rec.EOF
ReDim Preserve MdlMain.LoginQx(UBound(MdlMain.LoginQx, 1) + 1)
MdlMain.LoginQx(UBound(MdlMain.LoginQx, 1) - 1).QxName = Rec.Fields("bh").Value
MdlMain.LoginQx(UBound(MdlMain.LoginQx, 1) - 1).Warrant = Rec.Fields("warrant").Value
Rec.MoveNext
Loop
End If
Rec.Close: Set Rec = Nothing
FrmFlash.Show
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.KeyPreview = True
Me.Left = GetSetting(App.EXEName, "登录窗口", "left", (Screen.Width - Me.Width) / 2)
Me.Top = GetSetting(App.EXEName, "登录窗口", "top", (Screen.Height - Me.Height) / 2)
Call SetWindowPos(Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAG)
Me.Show
DTPicker1.Value = Now
cn.Open DbLoginSql
Rec.CursorLocation = adUseClient
Rec.Open "select * from loginuser order by userbh", cn, adOpenDynamic, adLockOptimistic
If Rec.EOF And Rec.BOF Then
cn.BeginTrans
cn.Execute "delete from loginwarrant"
Rec.AddNew
Rec.Fields("userbh").Value = "000"
Rec.Fields("username").Value = "supervistor"
Rec.Fields("password").Value = ConVertPwd("")
Rec.Update
cn.CommitTrans
Dim Rec1 As New ADODB.Recordset
Rec1.CursorLocation = adUseClient
Rec1.Open "select * from logingn,loginuser where loginuser.[username]='supervistor'", _
cn, adOpenDynamic, adLockOptimistic
If Not Rec1.EOF And Not Rec1.BOF Then
Do While Not Rec1.EOF
cn.Execute "insert into loginwarrant([userbh],[username],bh,[warrant]) " & _
" Values('" & Rec1.Fields("userbh") & "','" & Rec1.Fields("username") & _
"','" & Rec1.Fields("bh") & "','1')"
Rec1.MoveNext
Loop
End If
Rec1.Close
Set Rec1 = Nothing
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 + -