我想对自己的程序加密,想来想去还是用注册方式比较好,我看到有些程序能够获得CPU ID、硬盘序列号、主板序号等生成一个机器指纹,然后再生成注册吗?
可是如何获得上述信息?
注册吗要怎样运算生成?
最好有代码实例,一定给分

解决方案 »

  1.   

    给个e-mail我,我上次下载了一个这样子的程序,,但我我忘记了在那个网站下载的,如果你没有e-mial的话,那你自己上www.dapha.net找找,我印象中是在哪里下载的不过好象这里也有哎,忘记了
      

  2.   

    我的邮件地址:
    [email protected]
    你说的不会是Delphi的吧?最好有VB的,谢谢,请先给我一份。
      

  3.   

    ''******************************************************************************
    ''
    ''_@(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
      

  4.   

    谢谢楼上,不知如何得到CPU的ID呢?主板序列号?谢谢!另外,硬盘序列号我认为也可以通过FSO对象的Driver对象的Sn属性得到。