有一个pdf,有一个元数据字段“ /NC_ID( ”。我可以在记事本中看到它。我想让我把它读成txt,然后搜索“/NC_ID(”
var
LFileCertificate: TextFile;
LIndex, L_Length, LInd: integer;
begin
if OpenDialog1.Execute then
begin
AssignFile(LFileCertificate, OpenDialog1.FileName);
Reset(LFileCertificate);
while not Eof(LFileCertificate) do
begin
Readln(LFileCertificate, S);
if Pos('/NC_ID(', S) <> 0 then
begin
LInd := Pos('/NC_ID(', S);
showmessage(Copy(S, LInd, 20));
abort;
end;
//ShowMessage(S);
end;
ShowMessage('close file');
CloseFile(LFileCertificate);
end;
end;
它不存在,它
找到了这个字段,但条件是我删除了 blocknet 中的一半数据,但这不适合我。
为什么pos不能处理完整的文件。最大长度为“ string =2 GB ”。此设置位于文件末尾。
有一个功能
System.IOUtils.TFile.ReadAllText