📄 form1.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
BackColor = &H00FFFFFF&
BorderStyle = 1 'Fixed Single
Caption = "设备管理系统--欢迎登录"
ClientHeight = 3840
ClientLeft = 45
ClientTop = 330
ClientWidth = 6600
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3840
ScaleWidth = 6600
StartUpPosition = 3 '窗口缺省
Begin VB.Timer Timer1
Interval = 500
Left = 1800
Top = 2280
End
Begin VB.Timer Timer2
Enabled = 0 'False
Interval = 50
Left = 360
Top = 2400
End
Begin VB.TextBox Text4
DataField = "密码"
DataSource = "Adodc1"
Height = 435
Left = 5265
TabIndex = 5
Text = "Text4"
Top = 5520
Width = 1770
End
Begin VB.TextBox Text3
DataField = "帐号"
DataSource = "Adodc1"
Height = 510
Left = 585
TabIndex = 4
Text = "Text3"
Top = 5550
Width = 1755
End
Begin MSAdodcLib.Adodc Adodc1
Height = 420
Left = 1320
Top = 5580
Width = 4035
_ExtentX = 7117
_ExtentY = 741
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBString = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=test;Data Source=(local)"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from table1_user"
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.TextBox Text2
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
IMEMode = 3 'DISABLE
Left = 1725
PasswordChar = "*"
TabIndex = 3
Top = 1125
Width = 1830
End
Begin VB.TextBox Text1
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1725
TabIndex = 2
Top = 510
Width = 1830
End
Begin VB.Image Image3
Height = 450
Left = 480
Picture = "Form1.frx":0000
Stretch = -1 'True
Top = 2040
Width = 1065
End
Begin VB.Image Image2
Height = 450
Left = 480
Picture = "Form1.frx":3B76
Stretch = -1 'True
Top = 2040
Visible = 0 'False
Width = 1065
End
Begin VB.Image Image1
Height = 450
Left = 2400
Picture = "Form1.frx":78F3
Stretch = -1 'True
Top = 2040
Width = 1065
End
Begin VB.Label Label2
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户密码"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 405
TabIndex = 1
Top = 1245
Width = 915
End
Begin VB.Label Label1
Alignment = 2 'Center
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "用户帐号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Left = 435
TabIndex = 0
Top = 600
Width = 915
End
Begin VB.Image Image4
Height = 450
Left = 2400
Picture = "Form1.frx":B446
Stretch = -1 'True
Top = 2040
Visible = 0 'False
Width = 1065
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim j As Integer
Private Sub Form_Load()
If App.PrevInstance = True Then
Unload Me
Exit Sub
End If
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Text1.Text = ""
Text2.Text = ""
i = 0
j = 1
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = True
Image4.Visible = False
Image3.Visible = True
Image2.Visible = False
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
Image4.Visible = True
End Sub
Private Sub Image2_Click()
Adodc1.RecordSource = "select * from Table1_user where 帐号='" & Text1.Text & "'"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
If Trim(Text2.Text) = Trim(Text4.Text) Then
With Form2
.Check1.Value = Adodc1.Recordset.Fields("功能一")
.Check2.Value = Adodc1.Recordset.Fields("功能二")
.Check3.Value = Adodc1.Recordset.Fields("功能三")
.Check4.Value = Adodc1.Recordset.Fields("功能四")
.Check5.Value = Adodc1.Recordset.Fields("功能五")
End With
Form2.StatusBar1.Panels.Item(3).Text = "当前操作员帐号: " + Adodc1.Recordset.Fields("帐号")
Form2.Width = 1770
Form2.Height = 1328
Form2.Show
Timer2.Enabled = True
' Me.Hide
Else
If i >= 2 Then
MsgBox "对不起,您已经3次利用错误的口令登录本系统,请您重新登录并且输入正确的口令!!", 64, "用户管理系统--演示"
End
Else
i = i + 1
End If
MsgBox "密码不正确,请您确认后重新输入"
Text2.Text = ""
Text2.SetFocus
End If
Else
MsgBox "对不起 没有此用户的信息"
Text2.Text = ""
Text1.Text = ""
Text1.SetFocus
End If
End Sub
Private Sub Image3_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image3.Visible = False
Image2.Visible = True
End Sub
Private Sub Image4_Click()
Unload Me
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Text2.SetFocus
Else
End If
End Sub
Private Sub Text2_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 13 Then
Call Image2_Click
Else
End If
End Sub
Private Sub Timer1_Timer()
If j = 1 Then
Else
j = 2
Image5.Visible = True
Image6.Visible = False
j = 1
End If
End Sub
Private Sub Timer2_Timer()
With Form2
If .Width < 15360 Then
.Width = .Width + 1000
.Height = .Height + 750
Else
Timer2.Enabled = False
Unload Me
End If
.Move (Screen.Width - .Width) / 2, (Screen.Height - .Height) / 2
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -