Z zbdbx Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-27 #1 怎么将流转化为字符串??? 还有就是把字符串转化为流?? 请高手们给出源码!我用于网络传输
L levi Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-27 #2 看一下HexToBin函数的使用方法,你还可以看IniFile.writeStream与ReadStream的源码,从中可以得到启示
N nicai_wgl Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-28 #3 流转化为字符串 stream.read(str, Length(str)); 字符串转化为流 stream.write(str, Size);
E errorcode Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-30 #4 流转化为字符串 Size := Stream.Size; SetLength(str, Size); stream.read(str[1], Size); Socket.SendText(str); or if Stream is TMemoryStream then with TMemoryStream(Stream) do Socket.SendBuf(Memory^, Size); 字符串转化为流 stream.write(str[1], Length(str));
流转化为字符串 Size := Stream.Size; SetLength(str, Size); stream.read(str[1], Size); Socket.SendText(str); or if Stream is TMemoryStream then with TMemoryStream(Stream) do Socket.SendBuf(Memory^, Size); 字符串转化为流 stream.write(str[1], Length(str));
B boldfake Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-30 #6 首先網羅傳輸可以直接傳送流啊 可以使用TStringStream,有屬性DataString,就是字符串