Ver Mensaje Individual
  #2  
Antiguo 26-05-2004
Avatar de acertij022
acertij022 acertij022 is offline
Miembro
 
Registrado: may 2003
Ubicación: Argentina-Bs. As.
Posts: 233
Reputación: 22
acertij022 Va por buen camino
Lightbulb

Código Delphi [-]
function InternetConnected:Boolean;
   function LocalIP:string;
   var
       phe : PHostEnt;
       pptr : PaPInAddr;
       Buffer : array [0..63] of char;
       I : Integer;
       GInitData : TWSADATA;
   begin
       WSAStartup($101, GInitData);
       Result := '';
       GetHostName(Buffer, SizeOf(Buffer));
       phe :=GetHostByName(buffer);
       if phe = nil then
       begin
          Exit;
       end;
       pptr := PaPInAddr(Phe^.h_addr_list);
       I := 0;
       while pptr^[i] <> nil do
       begin
          Application.ProcessMessages;
          result:=StrPas(inet_ntoa(pptr^[i]^));
          Inc(I);
       end;
       WSACleanup;
   end;
var
   S:string;
begin
   S:=Copy(LocalIP,1,3);
   Result:=(S < '255') and (S > '127');
end;


Esta funsión ami me funciona espero que te sea de utilidad
Responder Con Cita