![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
#4
|
|||
|
|||
|
Yo utilizo el siguiente código para descargar ficheros de internet.
kurl contiene la dirección url completa del fichero (ej. http://achilipu.com/arriquitaun.jpg) y el fichero se copia en c:\fichero.jpg Para que funcione debes añadir wininet en la lista de uses. Espero que te sirva Saludos Hogol procedure TForm1.descarga(kurl:string); var hHttpSession, hReqUrl: HInternet; Buffer: array [0..1023] of Char; nRead: Cardinal; nwrite : Integer; ToF : file; begin hHttpSession := InternetOpen ('FindWeb', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0); hReqUrl := InternetOpenURL (hHttpSession, PChar(kurl),nil,0,0,0); AssignFile(ToF, 'c:\fichero.jpg'); Rewrite(ToF, 1); repeat InternetReadFile (hReqUrl, @Buffer, sizeof (Buffer), nRead); BlockWrite(ToF, Buffer, nRead, nWrite); until nRead = 0; InternetCloseHandle (hReqUrl); closefile(ToF); InternetCloseHandle (hHttpSession); end; |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
|