function CheckOffline: boolean;
var
ConnectState: DWORD;
StateSize: DWORD;
begin
result:=InternetCheckConnection('http://www.sina.com.cn/', 1, 0);
exit;
ConnectState:= 0;
StateSize:= SizeOf(ConnectState);
result:= false;
if InternetQueryOption(nil, INTERNET_OPTION_CONNECTED_STATE, @ConnectState,StateSize) then
if (ConnectState and INTERNET_STATE_DISCONNECTED) <> 2 then result:= true;
end;