use WinIet;
function InternetConnected: Boolean;
var
InetState: DWORD;
hHttpSession, hReqUrl: HInternet;
begin
Result:= InternetGetConnectedState(@InetState, 0);
if (Result and (InetState and INTERNET_CONNECTION_CONFIGURED =
INTERNET_CONNECTION_CONFIGURED)) then begin
hHttpSession:= InternetOpen('agency', INTERNET_OPEN_TYPE_PRECONFIG, nil, nil, 0);
try
hReqUrl:= InternetOpenURL(hHttpSession, PChar(체크할 URL), nil, 0, 0, 0);
Result := hReqUrl <> nil;
InternetCloseHandle(hReqUrl);
finally
InternetCloseHandle(hHttpSession);
end;//end try
end
else if (InetState and INTERNET_CONNECTION_OFFLINE =
INTERNET_CONNECTION_OFFLINE) then
Result := False;
end;
'Academy I > Tech Academy' 카테고리의 다른 글
[Delphi]Save to Internet Image (0) | 2019.03.06 |
---|---|
[Delphi]글자가 한글인지 확인 (0) | 2019.03.06 |
[Delphi]Pointer (0) | 2019.02.20 |
[Delphi]인터넷 연결 상태 확인 (0) | 2019.01.31 |
[Delphi]Form이 없는 윈도우 종료 감지하기 (0) | 2019.01.31 |
[Delphi]익명함수+쓰레드를 활용한 간단한 쓰레드 사용 방법 (0) | 2019.01.31 |
[Delphi]Spring4d 강좌 3 Generic Collection Library (0) | 2019.01.31 |
[Delphi]Spring4d 강좌 2 Lazy Object Creation (0) | 2019.01.31 |