read streams line by line

前端 未结 2 618
你的背包
你的背包 2021-01-13 19:22

Is there a way in Delphi to read streams ,line by line?

Is there a way to set the encoding of the stream?

I know of

TEncoding.getEncodingPa         


        
2条回答
  •  死守一世寂寞
    2021-01-13 20:02

    Delphi versions that lack TStreamReader can use Peter Below's StreamIO unit, which gives you AssignStream. It works just like AssignFile, but for streams instead of file names. Once you've used that function to associate a stream with a TextFile variable, you can call ReadLn and the other I/O functions on it just like any other file.

提交回复
热议问题