小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

用VB制作注冊(cè)軟件的方法 — 編程愛(ài)好者 programfan.com

 林中雁 2011-10-21
我自己制作的一個(gè)注冊(cè)軟件,希望能給大家?guī)?lái)幫助
Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
''此模塊的作用是檢測(cè)用程序所在機(jī)器C盤(pán)序列號(hào)并存入一個(gè)加密后的文本文件yibao.ini中,
''在每次運(yùn)行時(shí)檢測(cè)C盤(pán)序列號(hào)并與加密文本文件中的相應(yīng)值進(jìn)行比較如果不符提示用戶進(jìn)行注冊(cè)

Public Reg_C As String
Public Reg_Key As Long
Public Jia_Mi_File As String
Public Jia_Mi_Char As String
Public Fso As New FileSystemObject
Public Ctf As TextStream



Public Function Jia_Mi_Txt()
Reg_C = Abs(GetSerialNumber("c:\"))
If Dir(App.Path & "\yibao.ini") = "" Then
''建立一個(gè)文本文件
Open App.Path & "\yibao.ini" For Output As #1
Print #1, "00000000"
Close #1
End If

Jia_Mi_File = App.Path & "\yibao.ini"
Set Fso = CreateObject("Scripting.FileSystemObject")

Set Ctf = Fso.OpenTextFile(Jia_Mi_File, 1) ''建立 TextStream 對(duì)象 CTF

Jia_Mi_Char = ""
Do While Ctf.AtEndOfStream <> True

Jia_Mi_Char = Jia_Mi_Char & Chr(58 Xor Asc(Ctf.Read(1)))
Loop

Ctf.Close
Set Ctf = Nothing

If Jia_Mi_Char <> Int(Reg_C * 18 / 22 * 16 / 19) Then
''顯示注冊(cè)對(duì)話框
Dialog.Show 1
End If

End Function


''Text2.Text = Len(Reg_C)


Function GetSerialNumber(sroot As String) As Long
Dim lserialnum As Long
Dim r As Long
Dim strlabel As String, strtype As String
strlabel = String$(255, Chr$(0))
strtype = String$(255, Chr$(0))
r = GetVolumeInformation(sroot, strlabel, Len(strlabel), lserialnum, 0, 0, strtype, Len(strtype))
GetSerialNumber = lserialnum
''在 strLabel 中為磁盤(pán)卷標(biāo)
''在 strType 中為文件系統(tǒng)類型
End Function

''此部分為程序加密處理模塊,負(fù)責(zé)將C盤(pán)的卷標(biāo)讀并轉(zhuǎn)換成數(shù)字
''對(duì)這串?dāng)?shù)字與58進(jìn)行異或處理,得到一個(gè)加密的字符串寫(xiě)入yibao.ini中
''在每次運(yùn)行時(shí)與文檔中的加密后字符串進(jìn)行反解密比較,不成功提示用戶進(jìn)行注冊(cè)

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多