Вниз
Скачать: CL | DM;

Посылаем файл!!!!   Найти похожие ветки 

 
Ламер 2.Х ©   (2007-01-07 21:36) [0]

Помогите, пожалуйста, найти ошибку файл полностью не приходит(скорее всего вообще не проходит)?

procedure TFileSend.ClientSocket1Read(Sender: TObject;
 Socket: TCustomWinSocket);
var
s, sl, NameOfFile: string;
i: integer;
begin
s:= Socket.ReceiveText;
if Reciving then
begin
fs.Write(s[1], length(s));
if fs.Size=DataSize then
begin
fs.Free;
Reciving:=false;
Application.MessageBox("Файл отправлен", "Сообщение");
ClientSocket1.Active:= false;
end;
exit;
end;
if copy(s, 1, 5)="Size:" then
begin
sl:=copy(s, 6, Pos(#0, s)-6);
DataSize:=StrToInt(sl);
Delete(s, 1, Pos(#0, s));
NameOfFile:= copy(s, 1, Pos(#0, s)-1);
showmessage(copy(s, 1, Pos(#0, s)-1));
Delete(s, 1, Pos(#0, s));
for i:= Length(NameOfFile) downto 1 do
if NameOfFile[i] = "\"
 then
  begin
    NameOfFile:= copy(NameOfFile,i+1,Length(NameOfFile)-i);
    showmessage (nameoffile);
  end;
Reciving:=true;
fs:=TFileStream.Create(NameOfFile,fmCreate);
fs.Write(s[1], length(s));
end;
end;


 
Dmitrij_K   (2007-01-07 22:30) [1]

Отладчик тебе для чего?
Проверяй какие данные приходят, как опи разбираются.



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.027 c
2-1168509042
D@Nger
2007-01-11 12:50
2007.01.28
Колесико мышки


2-1168362269
Cj
2007-01-09 20:04
2007.01.28
Получение пути фаила программы (процесса)


15-1167852215
vidiv
2007-01-03 22:23
2007.01.28
Ктонить может дать 100 wmr на 1 день...


15-1167807193
Slider007
2007-01-03 09:53
2007.01.28
С днем рождения ! 3 января


2-1168515363
nordic3
2007-01-11 14:36
2007.01.28
Блокировка Ctrl




   Наверх