Jump to content
YOUR-AD-HERE
HOSTING
TOOLS

Locked [Función] Obtener IP [vb.net]


fudmario

Recommended Posts

[LENGUAJE=vb.net]

' Autor : Himanen(Version C#)

'Traducido: fudmario (vb.net)

'Funcion: Obtener IP,mediante la pagina cualesmiip

 

'Ejemplo de Uso:

'MessageBox.Show(getIP())

[/LENGUAJE]

[LENGUAJE=vb.net]

' Imports System.Net

'Imports System.IO

 

Public Function getIP()

Try

 

Dim fr As HttpWebRequest

Dim codehtml As String = String.Empty

Dim targeturi As Uri = New Uri("http://www.cualesmiip.com/")

fr = HttpWebRequest.Create(targeturi)

 

Dim st As StreamReader = New StreamReader(fr.GetResponse().GetResponseStream)

codehtml = st.ReadToEnd

st.Close()

Dim cad1 As String = "Tu IP real es"

Dim cad2 As String = "("

Dim s As Short

s = codehtml.IndexOf(cad1) + cad1.Length + 1

 

Return Trim(Mid(codehtml, s, codehtml.Substring(s).IndexOf(cad2) + 1))

 

Catch ex As Exception

Return "Error"

End Try

End Function

[/LENGUAJE]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.