Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-28-2001, 03:47 AM
djr171 djr171 is offline
Junior Member
 
Join Date: Jan 2001
Posts: 4
Default PLEASE HELP Image Downloader...

Can someone make me a program which can be used to download a METOSAT photo every half hour using a manually conected AOL connection. It must download : http://satpix.nottingham.ac.uk/satpix/latest/jpg/D2.JPG
every half hour and rename the file to meto1, meto2 etc..
I need it for my school.

Please Help.

PS It doesn't need to bve able to view the JPEG files.

THX

Please Send It To : DJRoast@tesco.net
Reply With Quote
  #2  
Old 01-28-2001, 04:17 PM
Wise Guy Wise Guy is offline
Member
 
Join Date: Jan 2001
Posts: 45
Default RE: PLEASE HELP Image Downloader...

Hey!

Ok... Here's a sample application. I made a sample unit for you and it works and does just what you need. Here's the code:

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Psock, NMHttp, ComCtrls, ExtCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
HTTP: TNMHTTP;
Memo1: TMemo;
SB: TStatusBar;
Timer1: TTimer;
procedure Button1Click(Sender: TObject);
procedure HTTPSuccess(Cmd: CmdType);
procedure HTTPFailure(Cmd: CmdType);
procedure HTTPConnect(Sender: TObject);
procedure HTTPConnectionFailed(Sender: TObject);
procedure HTTPDisconnect(Sender: TObject);
procedure HTTPHostResolved(Sender: TComponent);
procedure HTTPPacketRecvd(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
begin
HTTP.Get('http://satpix.nottingham.ac.uk/satpix/latest/jpg/d2.jpg');
end;

procedure TForm1.HTTPSuccess(Cmd: CmdType);
begin
Memo1.Lines.Add('File''s done');
end;

procedure TForm1.HTTPFailure(Cmd: CmdType);
begin
Memo1.Lines.Add('Failure');
end;

procedure TForm1.HTTPConnect(Sender: TObject);
begin
Memo1.Lines.Add('Connected');
end;

procedure TForm1.HTTPConnectionFailed(Sender: TObject);
begin
Memo1.Lines.Add('Connection Failed!');
end;

procedure TForm1.HTTPDisconnect(Sender: TObject);
begin
Memo1.Lines.Add('Disconnected');
end;

procedure TForm1.HTTPHostResolved(Sender: TComponent);
begin
Memo1.Lines.Add('Host Resolved');
end;

procedure TForm1.HTTPPacketRecvd(Sender: TObject);
var B : Integer;
begin
B:=HTTP.BytesRecvd;
If B <> 0 then
SB.SimpleText:='Packed received. Size: ' + IntToStr(B)+' bytes out of '+IntToStr(HTTP.BytesTotal)+' transferred';
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
HTTP.Get('http://satpix.nottingham.ac.uk/satpix/latest/jpg/d2.jpg');
end;

end.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 08:23 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.