var
MS1,MS2:TMemoryStream;
FileName1,FileName2:string;
begin
MS1:=TMemoryStream.Create;
MS2:=TMemoryStream.Create;
FileName1:= 'C:\Documents and Settings\Administrtor\My Documents\My Pictures\200311813492623679.JPG ';
FileName2:= 'C:\Documents and Settings\Administrtor\My Documents\My Pictures\200311813502850073.JPG ';
try
MS1.LoadFromFile(FileName1);
MS2.LoadFromFile(FileName2);
if MS1.Size <> MS2.Size then
begin
ShowMessage( '不同 ');
Exit;
end;
if CompareMem(MS1.Memory,MS2.Memory,MS1.Size) then
ShowMessage( '相同 ')
else
ShowMessage( '不同 ');
finally
MS1.Free;
MS2.Free;
end;
end;