二进制流!没有关系,用Tfilestream进行读取就行了吧?

解决方案 »

  1.   

    为什么一定要用TFileStream来存储呢?
    如果你要把String存储为文本文件的话,可以用TFILE来存储的,
    var f:TFile of PChar;
    .
    .
    .
    for i:=1 to Length(Youstring) do
      Write(f,YourString[i]);
      

  2.   

    可以这样存储
    var
    TempStrList:TStringList;
    TempFileStream:TFileStream;
    begin
    tempstrlist:=tstringlist.create;
    tempfilestream:=TFileStream.Create(你的参数);
    tempstrlist.add(yourstring);//你的字符串
    tempstrlist.savetostream(tempfilestream);
    //下面的方法更直接简单了
    //tempstrlist.savetofile(filename);
    //最后释放对象
    tempstrlist.free;
    tempfilestream.free;
    end;