type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
E: EIdException;
begin
try
IdHTTP1.Head('http://www.delmadang.com/1234.gif');
ShowMessage('파일있음');
except on E: EIdException do
ShowMessage('파일이 없네...');
end;
IdHTTP1.Disconnect;
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient, IdHTTP, IdException;
type
TForm1 = class(TForm)
Button1: TButton;
IdHTTP1: TIdHTTP;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
E: EIdException;
begin
try
IdHTTP1.Head('http://www.delmadang.com/1234.gif');
ShowMessage('파일있음');
except on E: EIdException do
ShowMessage('파일이 없네...');
end;
IdHTTP1.Disconnect;
end;
end.
<!--CodeE-->
출처 : http://www.delmadang.com/cwb-bin/CrazyWWWBoard.exe?db=dmdqa&mode=read&num=110277&page=1&backdepth=1