views:

115

answers:

1

Hi All,

I am writing a win32 service in Delphi (should be able to translate any other code if you don't know delphi) that needs to fetch the status of a website. I know how to do this in .NET but am not sure with normal windows based programming. So, I need to query a website and return the Status Code 200, 301 ect. My plan is then to parse the data returned and send an email should one of my sites go down.

Can someone lend a hand?

EDIT: This is the code I used in the end - using the TIDHttp Indy component.

IdHTTP.Get('http://www.example.com');
  if IdHTTP.Connected then begin
     ResponseCode := IntToStr(IdHTTP.ResponseCode);
     ShowMessage(ResponseCode);
  end;
+5  A: 

Take Indy or Synapse library (both are free, indy is included with Delphi, synapse is found on google) and use their HTTP client class to do the job.

Eugene Mayevski 'EldoS Corp
Thanks, that sorted it.
webnoob