function IsOnline(const Url: String):Boolean;
var
ConnectState,StateSize:DWORD;
begin
Result:=False;
if not InternetCheckConnection(pchar(Url),1,0) then
Exit;
ConnectState:=0;
StateSize:=SizeOf(ConnectState);
if InternetQueryOption(nil,INTERNET_OPTION_CONNECTED_STATE,@ConnectState,StateSize) then
if (ConnectState and INTERNET_STATE_DISCONNECTED)<>2 then
Result:=True;
end;