基于Web的Dll Anti-Leech

时间:2019-01-29 12:46:11

标签: c++ dll

我正在尝试使功能像试用版一样,因此我可以打开/关闭.dll,这样当我关闭它时,人们无法使用它。有人可以帮助我实现此功能吗?我找到了一些公共源代码,但是我认为这还不够好

int trial(char *url)
{
        char output[16];
        HINTERNET hInternet; HINTERNET hFile; DWORD ReadSize;    BOOL bResult;
        hInternet = InternetOpen("Some USER-AGENT", INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, NULL);
        hFile = InternetOpenUrl(hInternet, url, NULL, NULL, INTERNET_FLAG_RELOAD, NULL);
        ReadSize = 15; bResult = InternetReadFile(hFile, output, 15, &ReadSize); output[ReadSize] = '\0';

        if (strcmp("ACTIVE", output))
        {
            MessageBox(0, "DLL IS AVAILABLE", "testing", MB_OK | MB_ICONINFORMATION);


        }
        else
        {
            MessageBox(0, "DLL IS NOT AVAILABLE", "testing", MB_OK | MB_ICONINFORMATION);
            ExitProcess(0);
        }
        return 0;
}

0 个答案:

没有答案