Ver Mensaje Individual
  #9  
Antiguo 04-07-2011
maxinitto maxinitto is offline
Miembro
 
Registrado: may 2010
Posts: 45
Reputación: 0
maxinitto Va por buen camino
es que mira el codigo conforme lo copio de aki me tira error, yo estoy modificando algunas cosas mira lo estoy dejando en un procedimiento

Código Delphi [-]
procedure EnviarArchivo(nombre : string);
var
  St:TFileStream;
begin
try

  If nombre <> '' then begin
    st:=TFileStream.Create(nombre ,fmopenread);
   // en esta linea envio el nombre del arhicvo y el tamaño.
    Form1.s3.Socket.WriteLn('CMD#SNDFile#'+ExtractFileName(nombre)+'#'+IntToStr(st.Size));
   // luego de enviar el mensaje, leo el Buffer para ver si respondio que podia recibir el archivo.
    if Form1.s3.Socket.ReadLn = 'RCVFile#Ready' then begin
      Try
// envio el Stream
        client.WriteStream(st,true,true,st.Size);
      except
      end;
    end else
      ShowMessage('Cant Send the File');
  end;
finally
  St.Free;
end;
end;

en esta linea no aparece ningun metodo ni procemiento que haga write stream, s3 es el nombre del componente IdTCPClient, ya que uso conexion inversa, luego entonces el codigo se usa al reves tu me entiendes... ejejej

Código Delphi [-]
client.WriteStream(st,true,true,st.Size);
Responder Con Cita