我想对自己的程序加密,想来想去还是用注册方式比较好,我看到有些程序能够获得CPU ID、硬盘序列号、主板序号等生成一个机器指纹,然后再生成注册吗?
可是如何获得上述信息?
注册吗要怎样运算生成?
最好有代码实例,一定给分
可是如何获得上述信息?
注册吗要怎样运算生成?
最好有代码实例,一定给分
解决方案 »
- Microsoft ActiveX Data Objects Recordset 2.8Library的问题
- vb 中延时函数占用CPU100%。有办法解决吗?请高手帮忙。十分感谢
- 为什么把一个数据集数据插入到另一张表时会插少一条数据
- 在excel中实现类似“高级筛选”的功能
- VB中Edit的值每变化一次,mshflexgrid就增加一组数据,怎么实现啊?
- 如何取得计算机中两张网卡的IP地址?(在线等待)
- 关于运行时错误'91'?
- comboBox控件的取值问题
- 40分相送,VB中如何调用系统日期和时间?
- 菜鸟的问题,怎样在已有的窗体中激活打开另外的窗体
- 一个关于Oracle数据库的问题,请大侠相助. 急!!!
- 关于 文件上传
[email protected]
你说的不会是Delphi的吧?最好有VB的,谢谢,请先给我一份。
''
''_@(f) : GetDistrictInfo
''
''Function : Get District's Info 得到驱动器信息
''
''Return : GetDistrictInfo As Long
''
''Parameter : Optional RootPathName As String = "C"
'' Optional ByRef VName As String
'' Optional ByRef Serial As Long
'' Optional ByRef FSName As String
''
''******************************************************************************
Public Function GetDistrictInfo(Optional RootPathName As String = "C", _
Optional ByRef VName As String, _
Optional ByRef Serial As Long, _
Optional ByRef FSName As String) As Long Serial = 0
VName = String$(255, Chr$(0))
FSName = String$(255, Chr$(0)) GetDistrictInfo = GetVolumeInformation(RootPathName & ":\", _
VName, 255, Serial, 0, 0, FSName, 255) VName = Left$(VName, InStr(1, VName, Chr$(0)) - 1)
FSName = Left$(FSName, InStr(1, FSName, Chr$(0)) - 1)End Function
''******************************************************************************
''
''_@(f) : EncipherStr
''
''Function : Encipher String
''
''Return : EncipherStr As String
''
''Parameter : ByVal Content As String
'' ByVal Pass As String
''
''******************************************************************************
Public Function EncipherStr(ByVal Content As String, _
ByVal Pass As String) As String
Dim I As Long
Dim strTmp As String
Dim strASC As String
Dim lngCnt As Long lngCnt = Len(Content)
Content = CryptString(Content, Pass)
For I = 1 To lngCnt
strASC = Hex$(Asc(Mid$(Content, I, 1)))
strTmp = strTmp & Right$("0" & strASC, 2)
Next I EncipherStr = Right$("0" & Hex$(lngCnt), 2) & strTmpEnd Function''******************************************************************************
''
''_@(f) : DecryptStr
''
''Function : Decrypt String
''
''Return : DecryptStr As String
''
''Parameter : ByVal Content As String
'' ByVal Pass As String
''
''******************************************************************************
Public Function DecryptStr(ByVal Content As String, _
ByVal Pass As String) As String
Dim I As Long
Dim strASC As String
Dim strTmp As String
Dim strCnt As String
For I = 1 To Val("&H" & Left$(Content, 2))
strTmp = "&H" & Mid$(Content, 2 * I + 1, 2)
strCnt = strCnt & Chr$(strTmp)
Next strCnt = CryptString(strCnt, Pass) DecryptStr = strCnt
End Function