Fórum Como detectar se o pc está conectado a internet? #323536
16/06/2006
0
Bem, acho que não tem muito o que falar, é uma dúvida simples:
Como posso detectar se o pc está conectado a internet independente de ser discada ou banda larga?
Aproveitando o tópico (pra não precisar criar outro depois...). Como posso fazer para saber qual porta do pc está aberta?
Madcat
Curtir tópico
+ 0Posts
16/06/2006
Adriano Santos
uses
WinInet, ShellAPI;
[/quote:a5467fa627]
function TfFrmDcErro.RasConnectionCount: Boolean; var Flags: dword; X: dword; begin X := 0; // este valor deve ser zero senão falha if InternetGetConnectedState(@Flags, X) then begin if (Flags and INTERNET_CONNECTION_MODEM) <> 0 then ShowMessage(´discada/banda larga´) else if (Flags and INTERNET_CONNECTION_LAN) <> 0 then ShowMessage(´rede local)´ else if (Flags and INTERNET_CONNECTION_PROXY) <> 0 then ShowMessage(´proxy´); Result := True; end else Result := False; end;
if RasConnectionCount then //faz o que precisar.
Gostei + 0
16/06/2006
Madcat
Gostei + 0
16/06/2006
Madcat
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)