![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#1
|
|||
|
|||
|
componente MultiFileDownloader multithread para bajar http y ftp en indy 10
este es un componente que encontre en internet tenias unos errores que corregi pero ahora me funciona lo unico que el componente no se comunica
diciendome cuando termina la descarga ni cuantos bytes esta bajando si alguien me puede dar una mano se lo agradesco Código:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Buttons, IndyDownloads, ExtCtrls;
type
TForm1 = class(TForm)
URL: TEdit;
Redirections: TUpDown;
Edit2: TEdit;
Edit3: TEdit;
Debit: TUpDown;
Edit4: TEdit;
Tentatives: TUpDown;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
StatusBar1: TStatusBar;
Demarrer: TBitBtn;
ProgressBar1: TProgressBar;
Fichier: TEdit;
Label1: TLabel;
Button1: TButton;
SaveDialog1: TSaveDialog;
Arreter: TBitBtn;
Retenter: TBitBtn;
Pause: TBitBtn;
Label6: TLabel;
Timer1: TTimer;
procedure DemarrerClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure IndyDownloads1Succeeded(Sender: TComponent;
IndyDownloadableFile: TIndyDownloadableFile);
procedure IndyDownloads1Failed(Sender: TComponent;
IndyDownloadableFile: TIndyDownloadableFile);
procedure IndyDownloads1Work(Sender: TComponent;
IndyDownloadableFile: TIndyDownloadableFile);
procedure IndyDownloads1Suspended(Sender: TComponent;
IndyDownloadableFile: TIndyDownloadableFile);
procedure ArreterClick(Sender: TObject);
procedure RetenterClick(Sender: TObject);
procedure PauseClick(Sender: TObject);
procedure IndyDownloads1Redirect(Sender: TComponent;
IndyDownloadableFile: TIndyDownloadableFile);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
IndyDownloads1: TIndyDownloads;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin if SaveDialog1.Execute then Fichier.Text:=SaveDialog1.FileName; end;
procedure TForm1.DemarrerClick(Sender: TObject);
begin
if IndyDownloads1 = nil then
IndyDownloads1:=TIndyDownloads.Create(self);
IndyDownloads1.DownloadableFileList.Clear;
ProgressBar1.Position:=0;
StatusBar1.SimpleText:='En curso...';
Demarrer.Enabled:=false; Arreter.Enabled:=true; Retenter.Enabled:=false; Pause.Enabled:=true;
// Cada descarga (treahd) debe estar asociada con un identificador único para garantizar la coherencia con el hilo principal
IndyDownloads1.DownloadableFileList.Add(TIndyDownloadableFile.Create(URL.Text, Fichier.Text, IndyDownloads1.GetNextUniqueID, Debit.Position, Tentatives.Position, Redirections.Position));
// Ponemos en marcha la descarga
TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).Start;
end;
procedure TForm1.IndyDownloads1Succeeded(Sender: TComponent; IndyDownloadableFile: TIndyDownloadableFile);
begin
StatusBar1.SimpleText:='Termino';
Demarrer.Enabled:=true; Arreter.Enabled:=false; Retenter.Enabled:=false; Pause.Enabled:=false;
end;
procedure TForm1.IndyDownloads1Failed(Sender: TComponent; IndyDownloadableFile: TIndyDownloadableFile);
begin
StatusBar1.SimpleText:='Error';
Demarrer.Enabled:=true; Arreter.Enabled:=true; Retenter.Enabled:=true; Pause.Enabled:=false;
end;
procedure TForm1.IndyDownloads1Work(Sender: TComponent; IndyDownloadableFile: TIndyDownloadableFile);
begin
ProgressBar1.Max:= TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).TotalFileSize;
ProgressBar1.Position:=TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).BytesDownloaded;
end;
procedure TForm1.IndyDownloads1Suspended(Sender: TComponent; IndyDownloadableFile: TIndyDownloadableFile);
begin
Demarrer.Enabled:=true; Pause.Enabled:=false;
if IndyDownloadableFile.State=si_Paused then
begin
StatusBar1.SimpleText:='Suspendido';
Arreter.Enabled:=true; Retenter.Enabled:=true;
end
else
begin
StatusBar1.SimpleText:='Parado';
Arreter.Enabled:=false; Retenter.Enabled:=false;
end;
end;
procedure TForm1.ArreterClick(Sender: TObject);
begin
if Assigned(IndyDownloads1.DownloadableFileList[0]) and
(TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).State in [si_Downloading, si_Failed]) then
TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).Stop;
Demarrer.Enabled:=true; Arreter.Enabled:=false; Retenter.Enabled:=false; Pause.Enabled:=false;
ProgressBar1.Position:=0; StatusBar1.SimpleText:='';
end;
procedure TForm1.RetenterClick(Sender: TObject);
begin
if Assigned(IndyDownloads1.DownloadableFileList[0]) and
(TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).State in [si_Paused, si_Failed]) then
begin
TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).Resume;
StatusBar1.SimpleText:='En curso...';
end;
Demarrer.Enabled:=false; Arreter.Enabled:=true; Retenter.Enabled:=false; Pause.Enabled:=true;
end;
procedure TForm1.PauseClick(Sender: TObject);
begin
if Assigned(IndyDownloads1.DownloadableFileList[0]) and
(TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).State=si_Downloading) then
TIndyDownloadableFile(IndyDownloads1.DownloadableFileList[0]).Pause;
Demarrer.Enabled:=false; Arreter.Enabled:=true; Retenter.Enabled:=false; Pause.Enabled:=false;
end;
procedure TForm1.IndyDownloads1Redirect(Sender: TComponent; IndyDownloadableFile: TIndyDownloadableFile);
begin
StatusBar1.SimpleText:='Redirection : '+IndyDownloadableFile.URL;
end;
end.
|
|
#2
|
||||
|
||||
|
En estos casos creo que es más sencillo que crees un ZIP con el proyecto de ejemplo y lo subas como adjunto. Si todavía no tienes permisos o es demasiado grande envíamelo por privado o por correo que yo mismo lo subo.
Otra opción es utilizar algun servidor gratuíto tipo RapidShare/Megaupload o el propio FTP del Club. He borrado los dos mensajes largos y aquí está el proyecto.
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi ![]() P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. Última edición por Neftali [Germán.Estévez] fecha: 18-01-2010 a las 16:12:22. |
|
#3
|
|||
|
|||
|
Tenes razon no se me habia ocurrido el subirlo a algun servidor gratuito
esta probado con indy 10 aca esta en dos servidores yo uso delphi 7 y indy 10 megaupload.com/?d=10EEBVKH rapidshare.com/files/337244512/indydownloads.rar.html le falta http ya que no tengo permiso para poner enlaces |
|
#4
|
||||
|
||||
|
Y ya está también en el FTP del Club.
__________________
Germán Estévez => Web/Blog Guía de estilo, Guía alternativa Utiliza TAG's en tus mensajes. Contactar con el Clubdelphi ![]() P.D: Más tiempo dedicado a la pregunta=Mejores respuestas. |
![]() |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Con Indy 10.1.5 ¿Transferencias de archivo avanzadas con HTTP y ftp? | JXJ | Varios | 1 | 07-07-2008 18:21:40 |
| donde puedo bajar el componente IMAGENPLUS | kurono | Varios | 0 | 22-03-2008 20:58:57 |
| Peticiones HTTP - Componente del Builder C++ | 8051 | C++ Builder | 2 | 01-02-2008 16:10:56 |
| HTTP Indy | bochi | Internet | 1 | 27-12-2003 01:57:34 |
| Indy, HTTP y Proxy Authentication | jmselesan | Internet | 0 | 23-10-2003 15:32:10 |
|