白 白河愁 Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-21 #3 var ff: TMemoryStream; Buf: PChar; begin ff:= TMemoryStream.Create; ff.LoadFromFile('c:/111.bin'); Buf:= ff.Memory; //此数组为文件内容 ff.Free; //释放就没有了。 end; end;
var ff: TMemoryStream; Buf: PChar; begin ff:= TMemoryStream.Create; ff.LoadFromFile('c:/111.bin'); Buf:= ff.Memory; //此数组为文件内容 ff.Free; //释放就没有了。 end; end;
K kaida Unregistered / Unconfirmed GUEST, unregistred user! 2007-05-21 #5 var F: file; NumRead: DWord; Buf: array[0..3] of Char; begin AssignFile(F, FromFile); Reset(F, 1); { Record size = 1 } repeat BlockRead(FromF, Buf, SizeOf(Buf), NumRead); //......处理 Buf 中的数据 until (NumRead = 0); System.CloseFile(F); end;
var F: file; NumRead: DWord; Buf: array[0..3] of Char; begin AssignFile(F, FromFile); Reset(F, 1); { Record size = 1 } repeat BlockRead(FromF, Buf, SizeOf(Buf), NumRead); //......处理 Buf 中的数据 until (NumRead = 0); System.CloseFile(F); end;