readkey.cpp

来自「此为本书的配套光盘.本书不但由浅入深地讲解了软件保护技术」· C++ 代码 · 共 30 行

CPP
30
字号
// readkey.cpp : Defines the entry point for the application.
//

#include "stdafx.h"
#include <windows.h>
#include <io.h>

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
	int iRet = access("key.dat",0);

	if(iRet!=-1)	//如key.dat存在
	{
		//执行程序的正常功能
		//…		
		MessageBox(NULL,"工作正常","信息",MB_OK);
	}
	else						//如key.dat不存在
	{
		MessageBox(NULL,"请注册后使用","Error",MB_OK);
	}
	return 0;
}



⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?