5
5411
Unregistered / Unconfirmed
GUEST, unregistred user!
type TransHeader = packed record
NumID:array [0..1] of char;
Ver:array [0..1] of char;
DataGrossLen:integer;
nonsymmetryClass:char;
symmetrykeyLen:smallint;
symmetryclass:char;
symmetrydataLen:integer;
TaxID:array [0..19] of char;
Reserver:array [0..7] of char;
CRC:integer;
end;
procedure TForm1.Button10Click(Sender: TObject);
var TempValue :array of byte;
dataHeader: TransHeader;
i: integer;
p: array of byte;
sl: integer;
begin
opendialog1.Execute;
ssoufilestream := TFileStream.Create(opendialog1.FileName,fmOpenRead);
ssoufilestream.Seek(0,soFromBeginning);
setlength(TempValue,ssoufilestream.Size);
ssoufilestream.Read(TempValue[0],ssoufilestream.Size); //读一段文件流
p := @dataHeader;
for i := 0 to 47 do
begin
p := tempvalue; //从读得的流中按字节,给记录类型的对象赋值.
end;
showmessage(inttostr(dataheader.symmetrykeyLen)); //此处出错,说不能读地址:<
为什么?
end;
NumID:array [0..1] of char;
Ver:array [0..1] of char;
DataGrossLen:integer;
nonsymmetryClass:char;
symmetrykeyLen:smallint;
symmetryclass:char;
symmetrydataLen:integer;
TaxID:array [0..19] of char;
Reserver:array [0..7] of char;
CRC:integer;
end;
procedure TForm1.Button10Click(Sender: TObject);
var TempValue :array of byte;
dataHeader: TransHeader;
i: integer;
p: array of byte;
sl: integer;
begin
opendialog1.Execute;
ssoufilestream := TFileStream.Create(opendialog1.FileName,fmOpenRead);
ssoufilestream.Seek(0,soFromBeginning);
setlength(TempValue,ssoufilestream.Size);
ssoufilestream.Read(TempValue[0],ssoufilestream.Size); //读一段文件流
p := @dataHeader;
for i := 0 to 47 do
begin
p := tempvalue; //从读得的流中按字节,给记录类型的对象赋值.
end;
showmessage(inttostr(dataheader.symmetrykeyLen)); //此处出错,说不能读地址:<
为什么?
end;