S
siaosa
Unregistered / Unconfirmed
GUEST, unregistred user!
客户端发送代码
var
mc:TMemoryStream;
begin
mc:=TMemoryStream.Create;
Image1.Picture.Bitmap.LoadFromFile('c:/001.bmp');
Image1.Picture.Bitmap.SaveToStream(mc);
mc.Position:=0;
idUDPClient1.SendBuffer(mc,mc.Size);
mc.Free;
end;
服务端接收代码
var
mc:TMemoryStream;
begin
mc:=TMemoryStream.Create;
mc.CopyFrom(AData,AData.Size);
mc.Position:=0;
mc.SaveToFile('c:/002.bmp');
end;
接端接收到文件的字节数是正确的,但002.bmp找开没有任何内容.为什么?
var
mc:TMemoryStream;
begin
mc:=TMemoryStream.Create;
Image1.Picture.Bitmap.LoadFromFile('c:/001.bmp');
Image1.Picture.Bitmap.SaveToStream(mc);
mc.Position:=0;
idUDPClient1.SendBuffer(mc,mc.Size);
mc.Free;
end;
服务端接收代码
var
mc:TMemoryStream;
begin
mc:=TMemoryStream.Create;
mc.CopyFrom(AData,AData.Size);
mc.Position:=0;
mc.SaveToFile('c:/002.bmp');
end;
接端接收到文件的字节数是正确的,但002.bmp找开没有任何内容.为什么?