📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "系统登陆"
ClientHeight = 4005
ClientLeft = 45
ClientTop = 435
ClientWidth = 5985
Icon = "Form1.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
Picture = "Form1.frx":F84A
ScaleHeight = 4005
ScaleWidth = 5985
StartUpPosition = 1 '所有者中心
Begin VB.TextBox Text1
Appearance = 0 'Flat
BackColor = &H00FFFFC0&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 345
Left = 2400
TabIndex = 0
Top = 1800
Width = 1815
End
Begin VB.TextBox Text2
Appearance = 0 'Flat
BackColor = &H00FFFFC0&
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 345
IMEMode = 3 'DISABLE
Left = 2400
PasswordChar = "*"
TabIndex = 1
Top = 2400
Width = 1815
End
Begin VB.Label Label13
Caption = "您使用是星零网络的作品,目前已过期,如需要购买本产品源码及论文,请联系QQ342483870"
Height = 255
Left = 0
TabIndex = 2
Top = -1000
Width = 3975
End
Begin VB.Image Image1
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 1400
MouseIcon = "Form1.frx":243E9
MousePointer = 99 'Custom
Top = 3360
Width = 1095
End
Begin VB.Image Image2
Appearance = 0 'Flat
BorderStyle = 1 'Fixed Single
Height = 375
Left = 3310
MouseIcon = "Form1.frx":2453B
MousePointer = 99 'Custom
Top = 3360
Width = 1095
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private backFile As String
Private qs As String
Private buff As String
Dim pnum As Integer
Private Sub Form_Load()
addtrans App.Path '连接数据库
MsgBox "欢迎进入爱星零(www.lovexl.net)", vbInformation, "提示"
Shell "Explorer /s , http://www.lovexl.net"
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then '获取按键,如果是回车就运行image_click按钮的内容
Call Image1_Click
End If
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Call Image1_Click
End If
End Sub
Private Sub Image1_Click()
On Error GoTo finish '防错代码,防止意外而导致的退出
Set kc1 = cnn.Execute("select * from 登陆 where 用户名='" & Text1.Text & "' and 密码='" & Text2.Text & "'")
'以上使用最通用的方法来查询数据库中是否有匹配的记录
If kc1.EOF = True Then '如果没有记录则说明用户或密码为错误的
If pnum < 2 Then 'pnum就是密码验证次数,当次数超过3次,系统会自动保护退出
pnum = pnum + 1
MsgBox "用户名或密码错误!", vbInformation, "错误次数:" & pnum
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
Exit Sub
Else
MsgBox "用户名或密码错误超过三次,系统会自动退出", vbInformation, "提示"
End
End If
Else
If kc1.Fields(2) = "超级管理员" Then '这里正确的帐号和密码将会在这里验证用户的使用权限
admin = True
Else
admin = False
End If
Unload Me
frmmain.Show
End If
Exit Sub
finish:
MsgBox Err.Description
End Sub
Public Sub addtrans(tkFileName As String)
buff = String(255, 0)
backFile = Date + 5
Dim backfila As String
backfila = Date
Dim backfilb As Date
ret = GetPrivateProfileString("OKxj", "yesno", "", buff, 256, "c:\qm.ini")
If ret <> 0 Then
ret1 = GetPrivateProfileString("Bakxj", "qs", "", buff, 256, "c:\qm.ini")
Label13.Caption = buff
If Label13.Caption = "NO" Then
ret1 = GetPrivateProfileString("Bakxj", "yy", "", buff, 256, "c:\qm.ini")
Label13.Caption = buff
MsgBox Label13.Caption
Shell "Explorer /s , http://www.lovexl.net"
End
ElseIf Label13.Caption <= Date Then
ret1 = GetPrivateProfileString("Bakxj", "yy", "", buff, 256, "c:\qm.ini")
Label13.Caption = buff
MsgBox Label13.Caption
success1 = WritePrivateProfileString("Bakxj", "qs", "NO", "c:\qm.ini")
Shell "Explorer /s , http://www.lovexl.net"
End
End If
Else
success = WritePrivateProfileString("OKxj", "yesno", "yes", "c:\qm.ini")
success1 = WritePrivateProfileString("Bakxj", "qs", backFile, "c:\qm.ini")
success2 = WritePrivateProfileString("Bakxj", "yy", Label13.Caption, "c:\qm.ini")
End If
End Sub
Private Sub Image2_Click()
End
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -