Dim Volume As String, SysName As String
Dim SerialNum As Long, SysFlags As Long, ComponentLength As Long, Res As Long
Dim SectorsPerCluster As Long, BytesPerSector As Long, NumberOfFreeClustors As Long, TotalNumberOfClustors As Long
Dim FreeBytes As Long, TotalBytes As Double, PercentFree As Long, Dl As Long
Volume = String(256, 0)
SysName = String(256, 0)
Dim DrvName As String
Dim texte1 As String
Dim texte2 As String
Dim texte3 As String
Dim ab As String
Dim ac As String
ab = "已正确注册,可以正常使用本软件,谢谢合作!"
ac = "对不起你的注册码有误,请重新核对后再试"
DrvName = "C:\"
Res = GetVolumeInformation(DrvName, Volume, 255, SerialNum, _
ComponentLength, SysFlags, SysName, 255)
If Str(SerialNum) < 0 Then
texte1 = Hex(Trim(Str(SerialNum) * (-1)))
Else
texte1 = Hex(Trim(Str(SerialNum)))
End If
DrvName = "D:\"
Res = GetVolumeInformation(DrvName, Volume, 255, SerialNum, _
ComponentLength, SysFlags, SysName, 255)
texte2 = Hex(Trim(Str(SerialNum)))
texte3 = texte1 + texte2
On Error GoTo er
AddPas
Dim yan As String
yan = texte1
For q = 1 To Len(yan)
sss = sss & Asc(Mid$(yan, q, 1))
Next q
yan = texte2
For w = 1 To Len(yan)
ss = ss & Asc(Mid$(yan, w, 1))
Next w
Dim tmp As String
'注释:若文件不存在,则建立文件
serrs = ss + sss
a = vkTextBox1.Text
If a = serrs Then
Open App.Path & "\win.tni" For Output As #1
Print #1, a
Close #1
MsgBox ab, vbInformation
Unload Me
zcx.Show
Else
MsgBox ac, vbInformation
End If
er: