유돌이

calendar

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

Notice

2010. 1. 11. 14:35 델파이

function ResponseCodeCheck(URL: String): Boolean;
var
  IdHTTP1: TIdHTTP;

begin
  Result := False;
  IdHTTP1 := TIdHTTP.Create;
  try
    IdHTTP1.Get(URL);

    case IdHTTP1.ResponseCode of
      200:
      begin
        Result := True;
        OutputDebugString('OK');
      end;

     403:OutputDebugString('Forbidden');
     404:OutputDebugString('Not Found');
     500:OutputDebugString('Server Error');

      else begin

        OutputDebugString('The Others ');

      end;
    end;
 finally
    FreeAndNil(IdHTTP1);
  end;


posted by 유돌이