PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 25 → WX - Meu Ip Fixo Externo
WX - Meu Ip Fixo Externo
Débuté par adrianoboller, 18 juil. 2015 19:31 - 2 réponses
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 18 juillet 2015 - 19:31
Procedure MeuIpFixo()

// function showInfos(){
//setTimeout('document.getElementById("div_ip").innerHTML = "177.6.166.73"', 1000);
//setTimeout('document.getElementById("div_reverso").innerHTML = "4130757575.e.brasiltelecom.net.br"', 2000);
//setTimeout('document.getElementById("div_provedor").innerHTML = "VELOX"', 3000);
//
//}

nInicioBloco, nFinalBloco is int = 0

IP is string = ""

Url is string = "http://www.meuip.com.br/"

HTTPRequest(Url)

bufRetorno is Buffer = HTTPGetResult(httpResult)

bufRetorno = Replace(bufRetorno,Charact(34),"")

bufRetorno = Replace(bufRetorno,"'","")

Info(bufRetorno)

nInicioBloco = PositionOccurrence(bufRetorno,"document.getElementById(div_ip).innerHTML = ",firstRank,FromBeginning) + Length("document.getElementById(div_ip).innerHTML = ")

Info(bufRetorno)

IF nInicioBloco > 0 THEN

//document.getElementById(div_ip).innerHTML = 177.6.166.73, 1000);
// setTimeout(document.getElementById(div_reverso).innerHTML = 4130757575.e.brasiltelecom.net.br, 2000);
//setTimeout(document.getElementById(div_provedor).innerHTML = VELOX, 3000);
//
// }
// </script>
//
// <div align=left ><br>
// <H1><b>      Meu IP: <div id=div_ip style=display:inline><!--<span class=style1> detectando (IPv4 ou IPv6)...</span>--> 177.6.166.73 </div> </b>

bufRetorno = Middle(bufRetorno,nInicioBloco,1000)

IF nInicioBloco > 0
bufRetorno = Middle(bufRetorno,1,20)
END

Info(bufRetorno)

ELSE

// <div align=left ><br>
// <H1><b>      Meu IP: <div id=div_ip style=display:inline><!--<span class=style1> detectando (IPv4 ou IPv6)...</span>--> 177.6.166.73 </div> </b>

nInicioBloco = PositionOccurrence(bufRetorno,"<span class=style1> detectando (IPv4 ou IPv6)...</span>-->",firstRank,FromBeginning) + Length("<span class=style1> detectando (IPv4 ou IPv6)...</span>-->")

IF nInicioBloco > 0
bufRetorno = Middle(bufRetorno,nInicioBloco,20)
END

Info(bufRetorno)

END


//192.168.1.180, 1000);

IF bufRetorno <> ""

nFinalBloco = PositionOccurrence(bufRetorno,",",firstRank,FromBeginning) - 1

IF nFinalBloco > 0 THEN
bufRetorno = Middle(bufRetorno,1,nFinalBloco)
END

END

Info(bufRetorno)

IP = NoSpace(bufRetorno)

RESULT(IP
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 18 juillet 2015 - 19:32
Forma de usar:

ip_fixo is string = MeuIpFixo()
Membre enregistré
3 651 messages
Popularité : +175 (223 votes)
Posté le 18 juillet 2015 - 19:32
:merci: