C
coolcat
Unregistered / Unconfirmed
GUEST, unregistred user!
怎么把一个stream的内容放入buffer中发送出去~~
下面的程序为什么有错??
procedure TForm1.Button1Click(Sender: TObject);
var
filestream:TMemoryStream;
sndDatachar;
begin
FileStream:=TMemoryStream.Create;
Filestream.LoadFromFile('c:/config.sys');
GetMem(sndData,Filestream.size);
FileStream.ReadBuffer(sndData,FileStream.Size);
sndData:=PChar(FileStream.Memory);
IDUDPClient1.SendBuffer(sndData,Filestream.size);
FileStream.Free;
FreeMem(sndData);
end;
请高手指点~~~
下面的程序为什么有错??
procedure TForm1.Button1Click(Sender: TObject);
var
filestream:TMemoryStream;
sndDatachar;
begin
FileStream:=TMemoryStream.Create;
Filestream.LoadFromFile('c:/config.sys');
GetMem(sndData,Filestream.size);
FileStream.ReadBuffer(sndData,FileStream.Size);
sndData:=PChar(FileStream.Memory);
IDUDPClient1.SendBuffer(sndData,Filestream.size);
FileStream.Free;
FreeMem(sndData);
end;
请高手指点~~~