实现对EXE文件的校验字节大小,防止程序被修改或中病毒.
const
//先定义文件的大小
ThisFileSize = 12429824 ;
function CheckThisFileSizeok:boolean;
var vv:ofstruct;
i,len1:integer;
begin
Result :=false;
i:=openfile(pchar(Application.exename),vv,0);
len1:=GetFileSize(i,nil);
_lclose(i);
if len1=ThisFileSize then
Result :=true;
end;