📄 form7.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form7
Caption = "山东科技大学物品管理系统"
ClientHeight = 2670
ClientLeft = 2970
ClientTop = 3330
ClientWidth = 6045
Icon = "Form7.frx":0000
LinkTopic = "Form7"
ScaleHeight = 2670
ScaleWidth = 6045
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 480
Top = 2160
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin VB.CommandButton Command2
Caption = "取消"
Height = 375
Left = 4560
TabIndex = 5
Top = 1800
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "确定"
Height = 375
Left = 4560
TabIndex = 4
Top = 1080
Width = 1095
End
Begin VB.TextBox Text3
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
IMEMode = 3 'DISABLE
Left = 2160
PasswordChar = "*"
TabIndex = 3
Top = 1920
Width = 1935
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2160
Locked = -1 'True
TabIndex = 2
Top = 960
Width = 1935
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 975
Left = 120
Picture = "Form7.frx":0E42
ScaleHeight = 975
ScaleWidth = 975
TabIndex = 1
Top = 120
Width = 975
End
Begin VB.ComboBox Combo1
Height = 300
Left = 2160
TabIndex = 0
Top = 1440
Width = 1935
End
Begin VB.Label Label4
Caption = "密码:"
Height = 255
Left = 1080
TabIndex = 10
Top = 2040
Width = 855
End
Begin VB.Label Label3
Caption = "用户名:"
Height = 255
Left = 1080
TabIndex = 9
Top = 1560
Width = 855
End
Begin VB.Label Label2
Caption = "操作日期:"
Height = 255
Left = 1080
TabIndex = 8
Top = 1080
Width = 975
End
Begin VB.Label Label1
Caption = "请输入用户名和密码,以便登录到本系统"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1440
TabIndex = 7
Top = 240
Width = 4215
End
Begin VB.Label Label5
Caption = "(密码区分大小写)"
Height = 255
Left = 2400
TabIndex = 6
Top = 600
Width = 1695
End
End
Attribute VB_Name = "Form7"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub SetWindowPos Lib "User32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Dim mimauser(), mimapass() As String
Dim success As Boolean
Dim logincount As Long
Private Sub Command1_Click()
If Text3.Text = "" Then
a = MsgBox("用户登录密码不能为空!", , "登录")
Exit Sub
End If
If Text3.Text = mimapass(Combo1.ListIndex + 1) Then
success = True
Main.Visible = True
Unload Me
Else
logincount = logincount + 1
a = MsgBox("用户非法,请授权登录!", , "登录")
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
If logincount >= 3 Then
a = MsgBox("用户非法,即将关闭!", , "关闭")
Unload Me
End If
End If
End Sub
Private Sub Command2_Click()
closecancel = True
Unload Me
End Sub
Private Sub Form_Initialize()
If Right(App.path, 1) = "\" Then ' 若 App.Path 为根目录
curpath = App.path
Else
curpath = App.path + "\"
End If
Adodc1.ConnectionString = " Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & curpath + "wupin.mdb;Persist Security Info=False"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from login"
Adodc1.Refresh
usercount = Me.Adodc1.Recordset.RecordCount
If Me.Adodc1.Recordset.RecordCount > 0 Then
ReDim mimauser(Me.Adodc1.Recordset.RecordCount)
ReDim mimapass(Me.Adodc1.Recordset.RecordCount)
Dim i As Integer
Me.Adodc1.Recordset.MoveFirst
Do Until Me.Adodc1.Recordset.EOF
i = i + 1
mimauser(i) = Me.Adodc1.Recordset.Fields("user").Value
Combo1.AddItem mimauser(i)
mimapass(i) = Me.Adodc1.Recordset.Fields("mima").Value
Me.Adodc1.Recordset.MoveNext
Loop
End If
Combo1.ListIndex = 0
End Sub
Private Sub Form_Load()
SetWindowPos Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Text1.Text = str(Date)
logincolse = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
If success = False Then
Unload Main
End If
End Sub
Private Sub Text3_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Command1_Click
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -