📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "PowerScada 注册"
ClientHeight = 2025
ClientLeft = 60
ClientTop = 450
ClientWidth = 5460
Icon = "Form1.frx":0000
LinkTopic = "Form1"
ScaleHeight = 2025
ScaleWidth = 5460
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton ComCheckId
Caption = "注 册"
Height = 420
Left = 1440
TabIndex = 2
Top = 1440
Width = 3735
End
Begin VB.TextBox Text2
Height = 375
Left = 1440
TabIndex = 1
Text = "Text1"
Top = 960
Width = 3735
End
Begin VB.TextBox Text1
Height = 375
Left = 1440
TabIndex = 0
Text = "Text1"
Top = 240
Width = 3735
End
Begin VB.Label Label2
Caption = "注册码:"
Height = 375
Left = 480
TabIndex = 4
Top = 1080
Width = 735
End
Begin VB.Label Label1
Caption = "安装序号:"
Height = 375
Left = 360
TabIndex = 3
Top = 360
Width = 855
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'得到某一磁盘分区的信息,如C:
Private RegID, LocalID As Long
Private Sub GetLocalID()
'根据C盘序列号得到原ID
Dim Driver, VolName, Fsys As String
Dim volNumber, MCM, FSF As Long
Dim vv As String
Driver = "c:\"
Dim res As Long
res = GetVolumeInformation(Driver, VolName, 127, volNumber, MCM, FSF, Fsys, 127)
'volNumber是C盘序列号
vv = str(volNumber)
vv = "1" + Right(vv, 1) + "1" + Mid(vv, 2, 1) + "67" + Mid(vv, 2, 1) + "87"
Text1.Text = vv
End Sub
Private Sub regedited()
'---------------------注册程序---------------
Dim aa As String
Dim DIR1 As String
aa = Dir("C:\WINDOWS", vbDirectory) '
If aa = "WINDOWS" Then
DIR1 = "C:\WINDOWS"
End If
aa = Dir("C:\WINNT", vbDirectory) '
If aa = "WININ" Then
DIR1 = "C:\WINNT"
End If
If DIR1 = "" Then
MsgBox ("注册不成功!")
Exit Sub
End If
Call CopyFile("D:\PowerScada\Local\license.SYS", DIR1 + "\Intellution\license.SYS", 1)
Call createnewkey(HKEY_CLASSES_ROOT, ".iekey")
Call setkeyvalue(HKEY_CLASSES_ROOT, ".iekey", "license", DIR1 + "\Intellution\slapi.dll", REG_SZ)
Call setkeyvalue(HKEY_CLASSES_ROOT, ".iekey", "license_file", DIR1 + "\Intellution\license.SYS", REG_SZ)
Call setkeyvalue(HKEY_CLASSES_ROOT, ".iekey", "license_id", &H2008, REG_DWORD)
End Sub
Private Sub ComCheckId_Click()
Dim aa As String
Dim BB As String
Dim CC As Long
CC = Val(Text1.Text)
BB = Text2.Text
If CheckId(CC, BB) Then
Call regedited
MsgBox ("注册成功")
Else
MsgBox ("注册码不正确!")
End If
End Sub
Private Sub Form_Load()
Call GetLocalID
Text2.Text = ""
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -