可以通过计算文件生成唯一的KEY,然后比较就行了。下面是一个CRC校验的函数:function GetFileCRC(pFileName: string): string;var i, j, crc, rCRC, Temp, Temp3: Integer; CRCTable: array[0..255] of Integer; f: TMemoryStream; p: PChar; Temp1, Temp2: byte; strFileName: string;begin result := ''; for i := 0 to 255 do begin crc := i; for j := 0 to 7 do begin if Boolean(crc and 1) then crc := Cardinal(crc shr 1) xor $EDB88320 else crc := crc shr 1; end; CRCTable := crc; end; f := TMemoryStream.Create; f.LoadFromFile(pFileName); if f.Size <= 0 then begin f.Free; exit; end; p := f.Memory; rCRC := -1; for i := 0 to f.Size - 1 do begin move(p, Temp1, 1); Temp2 := rCRC and $000000FF; Temp := Temp1 xor Temp2; rCRC := rCRC shr 8; move(CRCTable[Temp], Temp3, 4); rCRC := rCRC xor Temp3; end; rCRC := not rCRC; f.Free; result := Format('%x', [rCRC]);end;