Fórum Verificar conexão c internet, mas s pedir p conectar antes.. #149695
25/03/2003
0
Olá, gostaria de uma dica de como fazer p saber se a máquina está ou não conectada na internet. Já tentei várias opções, o problema é que todas pedem a conexão, ou seja: quando eu testo a conexão, aparece aquela janela do windows com uma mensagem estilo ´O aplicativo XXXXX requisitou uma conexão com www.xxxxxx.com.br..... deseja conectar agora?´ e isto está acabando com o meu programa quando ele roda em intranets com bloqueio de internet.... Alguma sugestão????
Valeu mesmo...
Valeu mesmo...
Leomuradas
Curtir tópico
+ 0
Responder
Posts
26/03/2003
Adilsond
uses
WinInet;
function InternetConectada: Boolean;
var
ConnectedState : DWord;
begin
InternetGetConnectedState(@ConnectedState, 0);
if (INTERNET_CONNECTION_LAN and ConnectedState = INTERNET_CONNECTION_LAN) or
(INTERNET_CONNECTION_MODEM and ConnectedState = INTERNET_CONNECTION_MODEM) or
(INTERNET_CONNECTION_PROXY and ConnectedState = INTERNET_CONNECTION_PROXY) then
Result := True
else
Result := False;
end;
WinInet;
function InternetConectada: Boolean;
var
ConnectedState : DWord;
begin
InternetGetConnectedState(@ConnectedState, 0);
if (INTERNET_CONNECTION_LAN and ConnectedState = INTERNET_CONNECTION_LAN) or
(INTERNET_CONNECTION_MODEM and ConnectedState = INTERNET_CONNECTION_MODEM) or
(INTERNET_CONNECTION_PROXY and ConnectedState = INTERNET_CONNECTION_PROXY) then
Result := True
else
Result := False;
end;
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)