如何給自己的軟體加上繫結電腦的註冊碼,不想讓它無限制傳播,我原意給高分
- 2023-01-31
原型:
int WINAPI icePub_machineGetInfo(int typeFlag,char *strInfo)
輸入:flag 模式標誌,1-5
輸出:strMachineCode 機器碼串
VC sample 程式碼:
CString str1;
char buff[1024];
typedef int (WINAPI ICEPUB_MACHINEGETINFO)(int typeFlag,char *strInfo);
ICEPUB_MACHINEGETINFO *icePub_machineGetInfo = 0;
HINSTANCE hDLLDrv = LoadLibrary(“icePubDll。dll”);
if(hDLLDrv)
{
icePub_machineGetInfo = (ICEPUB_MACHINEGETINFO *)GetProcAddress(hDLLDrv, “icePub_machineGetInfo”);
}
icePub_machineGetInfo(1,buff);
str1=buff;//mac
icePub_machineGetInfo(2,buff);
str1=str1+buff;//cpu
icePub_machineGetInfo(3,buff);
str1=str1+buff;//hard
icePub_machineGetInfo(4,buff);
str1=str1+buff;//memery
icePub_machineGetInfo(5,buff);
str1=str1+buff;//biosdate
AfxMessageBox(str1);
VB sample 程式碼:
Private Declare Function icePub_machineGetInfo Lib “icePubDll。dll” (ByVal typeFlag As Integer, ByVal strInfo As String) As Integer
Dim a2 As Integer
Dim str1 As String
str1 = Space(1024 * 10)
a2 = icePub_machineGetInfo(1, str1)
MsgBox “mac:” + str1
a2 = icePub_machineGetInfo(2, str1)
MsgBox “cpu:” + str1
a2 = icePub_machineGetInfo(3, str1)
MsgBox “hard:” + str1
a2 = icePub_machineGetInfo(4, str1)
MsgBox “memery:” + str1
a2 = icePub_machineGetInfo(5, str1)
MsgBox “boarddate:” + str1