J
job2125
Unregistered / Unconfirmed
GUEST, unregistred user!
用十六进制读出文件少了一些字符,例如用ultraEdit读出应该是:66 66 06 3E 04,我读出变成了66 66 6 3E 4。那些0开都的0都没有。
var
StrL, x,j,y: integer;
buf: array[0..500] of char;
SFile: file;
hexs:string;
begin
StrL := Length(stxt);
AssignFile(sfile, fn);
reset(sfile, 1);
repeat
buf := #0;
fpos := filepos(sfile);
blockread(sfile, buf, Sizeof(Buf), readnum);
form1.Memo1.Lines.Add(buf);
for j := 0 to high(buf) do
begin
hexs:=hexs+inttohex(byte(Buf[j]),1);
end;
form1.memo2.Lines.Add(hexs);
var
StrL, x,j,y: integer;
buf: array[0..500] of char;
SFile: file;
hexs:string;
begin
StrL := Length(stxt);
AssignFile(sfile, fn);
reset(sfile, 1);
repeat
buf := #0;
fpos := filepos(sfile);
blockread(sfile, buf, Sizeof(Buf), readnum);
form1.Memo1.Lines.Add(buf);
for j := 0 to high(buf) do
begin
hexs:=hexs+inttohex(byte(Buf[j]),1);
end;
form1.memo2.Lines.Add(hexs);