D
dali2000
Unregistered / Unconfirmed
GUEST, unregistred user!
发送:
procedure TForm_csrsy.Sendfile(filename:string);
var
FileStream: TFileStream;
begin
FileStream := TFileStream.Create(filename,fmOpenRead );
try
//FileStream.Position:=0;
IdUDPServer2.SendBuffer(remoteip1,7888,FileStream,FileStream.Size);
finally
FileStream.Free;
end;
end;
接收:
FileStream := TFileStream.Create(temppath+'ftmp.tmp', fmCreate);
try
//FileStream.Position:=0;
FileStream.CopyFrom(AData, AData.Size);
finally
FileStream.Free;
end;
运行结果不对,不能传输,应怎样用UDP进行传输文件,QQ是怎么实现的
procedure TForm_csrsy.Sendfile(filename:string);
var
FileStream: TFileStream;
begin
FileStream := TFileStream.Create(filename,fmOpenRead );
try
//FileStream.Position:=0;
IdUDPServer2.SendBuffer(remoteip1,7888,FileStream,FileStream.Size);
finally
FileStream.Free;
end;
end;
接收:
FileStream := TFileStream.Create(temppath+'ftmp.tmp', fmCreate);
try
//FileStream.Position:=0;
FileStream.CopyFrom(AData, AData.Size);
finally
FileStream.Free;
end;
运行结果不对,不能传输,应怎样用UDP进行传输文件,QQ是怎么实现的