Verifica conexão com a Internet usando xHarbour+TIP.LIB
Enviado: 12 Out 2007 03:55
*O Exemplo abaixo verifica a conexão com a Internet.
*Obs:tem que linkar a TIP.LIB
*Obs:tem que linkar a TIP.LIB
Código: Selecionar todos
IF VereficaNet()=.T.
@ 10,10 say "Conectado"
else
@ 10,10 say "Deconectado"
Endif
*******************************
Function VereficaNet( cAddress )
*******************************
LOCAL aHosts
LOCAL cName
InetInit()
IF cAddress == NIL
cAddress := "www.google.com.br"
ENDIF
aHosts := InetGetHosts( cAddress )
IF aHosts == NIL .or. len(aHosts)=0
InetCleanup()
RETURN .f.
endif
InetCleanup()
RETURN .t.