📄 register.frm
字号:
VERSION 5.00
Begin VB.Form Register
AutoRedraw = -1 'True
BorderStyle = 3 'Fixed Dialog
Caption = "<<<<<<<<<<<<<<<<<<<< 软件注册 >>>>>>>>>>>>>>>>>>>>>>"
ClientHeight = 4335
ClientLeft = 45
ClientTop = 330
ClientWidth = 5580
ControlBox = 0 'False
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4335
ScaleWidth = 5580
ShowInTaskbar = 0 'False
StartUpPosition = 2 '屏幕中心
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
Height = 1695
Left = 270
ScaleHeight = 1635
ScaleWidth = 3390
TabIndex = 8
Top = 1935
Width = 3450
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "2.http://mickeysoft.yeah.net登记"
ForeColor = &H000040C0&
Height = 180
Index = 1
Left = 180
TabIndex = 12
Top = 1290
Width = 2880
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "建设银行三溪分理处"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 210
Index = 1
Left = 405
TabIndex = 11
Top = 615
Width = 1890
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "33062787301047084101"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 240
Index = 0
Left = 390
TabIndex = 10
Top = 870
Width = 2715
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "1.汇款( 600 元人民币)到以下帐号"
ForeColor = &H000040C0&
Height = 180
Index = 0
Left = 180
TabIndex = 9
Top = 255
Width = 2790
End
End
Begin VB.CommandButton E_Button
Cancel = -1 'True
Caption = "关闭(&C)"
Height = 375
Left = 4035
TabIndex = 3
Top = 2430
Width = 1275
End
Begin VB.CommandButton R_Button
Caption = "注册(&R)"
Enabled = 0 'False
Height = 375
Left = 4035
TabIndex = 2
Top = 1980
Width = 1275
End
Begin VB.Frame Frame1
Caption = "注册信息"
ForeColor = &H00808000&
Height = 1500
Left = 255
TabIndex = 4
Top = 285
Width = 5040
Begin VB.TextBox NoTxt
Height = 270
Left = 1245
MaxLength = 40
TabIndex = 1
Top = 900
Width = 3465
End
Begin VB.TextBox CompanyTxt
Height = 270
Left = 1260
MaxLength = 40
TabIndex = 0
Top = 510
Width = 3450
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "序列号:"
ForeColor = &H00FF0000&
Height = 180
Left = 510
TabIndex = 6
Top = 945
Width = 720
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "公司名称:"
ForeColor = &H00FF0000&
Height = 180
Left = 330
TabIndex = 5
Top = 570
Width = 900
End
End
Begin VB.Label Label6
Caption = "F1 帮助"
ForeColor = &H00008000&
Height = 195
Left = 4320
TabIndex = 13
Top = 3195
Width = 765
End
Begin VB.Line Line2
BorderColor = &H00FFFFFF&
X1 = 270
X2 = 5310
Y1 = 3825
Y2 = 3825
End
Begin VB.Line Line1
X1 = 270
X2 = 5325
Y1 = 3810
Y2 = 3810
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "您的试用期 30 天,期满后,只有注册后才能再使用,请尽快注册。"
ForeColor = &H000040C0&
Height = 180
Left = 285
TabIndex = 7
Top = 3960
Width = 5130
End
End
Attribute VB_Name = "Register"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub CompanyTxt_Change()
If Trim(CompanyTxt.Text) <> "" And Trim(NoTxt.Text) <> "" Then
R_Button.Enabled = True
Else
R_Button.Enabled = False
End If
End Sub
Private Sub CompanyTxt_GotFocus()
CompanyTxt.HelpContextID = 1006
End Sub
Private Sub CompanyTxt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Trim(CompanyTxt.Text) <> "" Then
SendKeys "{tab}"
End If
End Sub
Private Sub E_Button_Click()
If MDIForm1.Visible Then
Unload Me
Else
End
End If
End Sub
Private Sub Form_Load()
'检测是否注册过
Dim sKeyName As String
Dim sEntry As String
Dim sRstr1 As String, sRstr2 As String, sRstr3 As String
Dim bSuccess As Boolean
'获得第一个值
sKeyName = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Register"
sEntry = "Register"
gbSkipRegErrMsg = True
sRstr1 = GetRegStringValue(sKeyName, sEntry)
If sRstr1 = "1" Then
'OK第2次使用系统
'获得第二个值
sKeyName = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup"
sEntry = "Register"
gbSkipRegErrMsg = True
sRstr2 = GetRegStringValue(sKeyName, sEntry)
'注册完成
If sRstr1 = "1" And sRstr2 = "8" Then
'注册完成
CompanyTxt.Enabled = False
CompanyTxt.Text = "已经注册过"
NoTxt.Enabled = False
NoTxt.Text = "已经注册过"
R_Button.Enabled = False
End If
'检查完毕
Else
'注册1
sKeyName = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Register"
sEntry = "Register"
sRstr1 = "1"
bSuccess = WriteRegStringValue(sKeyName, sEntry, sRstr1)
'注册2
sKeyName = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup"
sEntry = "Register"
sRstr2 = "0"
bSuccess = WriteRegStringValue(sKeyName, sEntry, sRstr2)
'注册3
sKeyName = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup"
sEntry = "Date"
sRstr3 = "1"
bSuccess = WriteRegStringValue(sKeyName, sEntry, sRstr3)
End If
Register.HelpContextID = 1006
End Sub
Private Sub NoTxt_Change()
If Trim(CompanyTxt.Text) <> "" And Trim(NoTxt.Text) <> "" Then
R_Button.Enabled = True
Else
R_Button.Enabled = False
End If
End Sub
Private Sub NoTxt_GotFocus()
NoTxt.HelpContextID = 1006
End Sub
Private Sub NoTxt_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 And Trim(NoTxt.Text) <> "" Then
SendKeys "{tab}"
End If
End Sub
Private Sub R_Button_Click()
'登记注册码
Dim CompanyS As String, NOS As String
Dim CompanyL As Integer, TempS As String
Dim TempX As String
CompanyS = Trim(CompanyTxt.Text)
NOS = Trim(NoTxt.Text)
'注册方法
CompanyL = Len(CompanyS)
Dim X As Integer
For X = 1 To CompanyL
TempX = Mid$(CompanyS, X, 1)
TempX = Asc(TempX) + Year(Date)
TempX = Abs(TempX)
If X <= 5 Then
TempS = TempS + TempX
End If
Next
If NOS = TempS Then
'注册系统
'检测是否注册过
Dim sKeyName As String
Dim sEntry As String
Dim sRstr1 As String, sRstr2 As String
Dim bSuccess As Boolean
'注册1
sKeyName = "HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Register"
sEntry = "Register"
sRstr1 = "1"
bSuccess = WriteRegStringValue(sKeyName, sEntry, sRstr1)
'注册2
sKeyName = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup"
sEntry = "Register"
sRstr2 = "8"
bSuccess = WriteRegStringValue(sKeyName, sEntry, sRstr2)
'提示注册完毕
MsgBox "注册完毕,感谢您对我们的信任。", vbOKOnly + vbInformation, "注册成功"
CompanyTxt.Enabled = False
NoTxt.Enabled = False
R_Button.Enabled = False
'关闭
Unload Me
If MDIForm1.Visible = False Then
MsgBox "现 在 系 统 将 自 动 关 闭 。", vbOKOnly + vbExclamation
End
Exit Sub
End If
Else
MsgBox "对不起!序列号不对,请重新输入。" & Chr(10) & Chr(13) & vbCrLf & "如果您已经付款,请与供应商联系。", vbOKOnly + vbExclamation, "注册未能完成"
CompanyTxt.Text = ""
NoTxt.Text = ""
CompanyTxt.SetFocus
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -