P Pipi. Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-13 #2 原来的MemoryStream.Size 先看到长度 创建几个 TMemoryStream, 新的 TMemoryStream.Read( Pointer(integer(原来的MemoryStream.Memory)+n*每部分长度), 每部分长度)
原来的MemoryStream.Size 先看到长度 创建几个 TMemoryStream, 新的 TMemoryStream.Read( Pointer(integer(原来的MemoryStream.Memory)+n*每部分长度), 每部分长度)
S SuperMMX Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-14 #3 这还不好办,想分几个就再创建几个, 然后分别把主memorystream 的值cut 过去,
S SuperMMX Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-14 #5 手头没有 delphi, 没法写, 对 memorystream 不熟。 对不起了。
S SuperMMX Unregistered / Unconfirmed GUEST, unregistred user! 2000-04-16 #6 还没人答吗?我就贴了: procedure TForm1.FormCreate(Sender: TObject); begin s := TMemoryStream.Create; s.LoadFromFile('c:/autoexec.bat'); s1 := TMemoryStream.Create; s2 := TMemoryStream.Create; end; procedure TForm1.FormDestroy(Sender: TObject); begin s.Free; s1.Free; s2.Free; end; procedure TForm1.Button1Click(Sender: TObject); begin s1.SetSize(s.Size div 2); s1.CopyFrom(s, s1.Size); s1.Position := 0; s2.SetSize(s.Size - s1.Size); s2.CopyFrom(s, s2.Size); s2.Position := 0; s.Position := 0; Memo1.Lines.LoadFromStream(s); Memo2.Lines.LoadFromStream(s1); Memo3.Lines.LoadFromStream(s2); end; 重新读的时候,要把 position 重新置位。
还没人答吗?我就贴了: procedure TForm1.FormCreate(Sender: TObject); begin s := TMemoryStream.Create; s.LoadFromFile('c:/autoexec.bat'); s1 := TMemoryStream.Create; s2 := TMemoryStream.Create; end; procedure TForm1.FormDestroy(Sender: TObject); begin s.Free; s1.Free; s2.Free; end; procedure TForm1.Button1Click(Sender: TObject); begin s1.SetSize(s.Size div 2); s1.CopyFrom(s, s1.Size); s1.Position := 0; s2.SetSize(s.Size - s1.Size); s2.CopyFrom(s, s2.Size); s2.Position := 0; s.Position := 0; Memo1.Lines.LoadFromStream(s); Memo2.Lines.LoadFromStream(s1); Memo3.Lines.LoadFromStream(s2); end; 重新读的时候,要把 position 重新置位。
W wjiachun Unregistered / Unconfirmed GUEST, unregistred user! 2000-07-28 #7 不要怪别人不理你,看看你自己能记住自己的帐号么?? 说说,shuoshuo,shshsh,sh1,sh2……,sh8,sh9…… 该结束的题自己结束吧!!!!!!