📄 login.frm
字号:
VERSION 5.00
Begin VB.Form frmLogin
BorderStyle = 1 'Fixed Single
Caption = "注册《美食向导》"
ClientHeight = 2340
ClientLeft = 45
ClientTop = 330
ClientWidth = 5235
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2340
ScaleWidth = 5235
StartUpPosition = 2 '屏幕中心
Begin VB.TextBox txtTele
Height = 270
Left = 1320
MaxLength = 20
TabIndex = 10
Top = 1560
Width = 3735
End
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "取消"
Height = 375
Left = 3600
TabIndex = 8
Top = 1920
Width = 1335
End
Begin VB.CommandButton cmdOK
Caption = "确定"
Default = -1 'True
Height = 375
Left = 1680
TabIndex = 7
Top = 1920
Width = 1335
End
Begin VB.TextBox txtRegCode
Height = 270
Left = 1320
MaxLength = 20
TabIndex = 6
Top = 1200
Width = 3735
End
Begin VB.TextBox txtRegName
Height = 270
Left = 1320
MaxLength = 30
TabIndex = 5
Top = 840
Width = 3735
End
Begin VB.TextBox txtName
Height = 270
Left = 1320
MaxLength = 30
TabIndex = 4
Top = 480
Width = 3735
End
Begin VB.Label Label5
Caption = "订餐电话:"
Height = 255
Left = 240
TabIndex = 9
Top = 1560
Width = 975
End
Begin VB.Label Label4
Caption = "注册号码:"
Height = 255
Left = 240
TabIndex = 3
Top = 1200
Width = 975
End
Begin VB.Label Label3
Caption = "注册名称:"
Height = 255
Left = 240
TabIndex = 2
Top = 840
Width = 975
End
Begin VB.Label Label2
Caption = "酒店名称:"
Height = 255
Left = 240
TabIndex = 1
Top = 480
Width = 975
End
Begin VB.Label Label1
Caption = "在使用本程序之前,请您先注册。"
Height = 255
Left = 240
TabIndex = 0
Top = 120
Width = 2775
End
End
Attribute VB_Name = "frmLogin"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Sub cmdCancel_Click()
Unload frmMain
Unload Me
End
End Sub
Private Sub cmdOK_Click()
Static N As Integer
If txtName = "" Then
MsgBox "“酒店名称”不能空白!", vbExclamation, "注册《美食向导》"
txtName.SetFocus
Exit Sub
End If
If txtRegName = "" Then
MsgBox "“注册名称”不能空白!", vbExclamation, "注册《美食向导》"
txtRegName.SetFocus
Exit Sub
End If
If txtRegCode = "" Then
MsgBox "“注册号码”不能空白!", vbExclamation, "注册《美食向导》"
txtRegCode.SetFocus
Exit Sub
End If
Dim strName As String
Dim strRegName As String
Dim strCode As String
Dim intFileNumber As Integer
strName = txtName
strRegName = txtRegName
strCode = txtRegCode
strTele = txtTele
intFileNumber = FreeFile
Dim strA As String
Dim strB As String
strA = strName & strRegName
Dim I As Integer
Dim lngCode As Long
For I = 1 To Len(strName & strRegName)
strB = Mid(strA, I, 1)
lngCode = lngCode + Asc(strB)
Next I
Dim strC As String
Dim lngC As Long
lngC = Val(Right(Str(lngCode), 2)) Xor 3824
strC = Chr((lngC Mod 26) + 65)
If strCode = strC & Str(lngCode Xor (Asc("L") + Asc("i") + Asc("s") + Asc("t"))) Then
Open WinDir & "Menu.ini" For Output As #intFileNumber
Write #intFileNumber, strName
Write #intFileNumber, strRegName
Write #intFileNumber, strCode
Close #intFileNumber
intFileNumber = FreeFile
Open AppDir & "Menu.tel" For Output As #intFileNumber
Write #intFileNumber, strTele
Close #intFileNumber
With frmMain
.Caption = strName & "-美食向导"
.lblHotelName = strName
.lblPrincipalName = strRegName
End With
strHotelName = strName
If Dir(AppDir & "Image\Main.jpg") <> "" Then
frmMain.Picture = LoadPicture(AppDir & "Image\Main.jpg")
End If
Unload Me
Else
MsgBox "注册号码与名称不匹配!", vbExclamation, "注册《美食向导》"
txtRegCode.SetFocus
SendKeys "{Home}+{End}"
N = N + 1
If N > 2 Then
MsgBox "请联系购买正版软件!谢谢!", vbExclamation, "注册《美食向导》"
cmdCancel_Click
End If
End If
End Sub
Private Sub Form_Load()
End Sub
Private Sub txtRegCode_Change()
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -