Z zhao0707 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-02 #1 如何读出无类型的文件,然后以二进制的形式把他读入到字符串当中 请给出详细的步骤,谢谢
卷 卷起千堆雪tyn Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-03 #3 无类型文件的操作用BlockRead和BlockWrite. 现在有更好的方法,也就是TFileStream或TMemoryStream.
Z zhao0707 Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-03 #4 林沐大虾:如果给出源代码,这100分就是小弟送给你的见面理了。:)
M mikedeakins Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-03 #5 ; pStream = new TMemoryStream(); pStream->LoadFromFile(sFileName); sContent = AnsiString((const char*)pStream->Memory, pStream->Size);
; pStream = new TMemoryStream(); pStream->LoadFromFile(sFileName); sContent = AnsiString((const char*)pStream->Memory, pStream->Size);
B bbkxjy Unregistered / Unconfirmed GUEST, unregistred user! 2001-05-19 #6 function FileToStr(const FileName: string): string; var MemoryStream: TMemoryStream; begin Result := ''; MemoryStream := TMemoryStream.Create; try MemoryStream.LoadFromFile(FileName); SetString(Result,PChar(MemoryStream.Memory),MemoryStream.Size); finally MemoryStream.Free; end; end;
function FileToStr(const FileName: string): string; var MemoryStream: TMemoryStream; begin Result := ''; MemoryStream := TMemoryStream.Create; try MemoryStream.LoadFromFile(FileName); SetString(Result,PChar(MemoryStream.Memory),MemoryStream.Size); finally MemoryStream.Free; end; end;