Jump to content
bc-vnt

IP Resolver in VB.NET and source code

Recommended Posts

Posted

Scanning result

Download it

Print with tool :

Immagine.png

Source :

Imports System.Xml
Imports System.IO
Public Class Form1
Private Sub btn_resolve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_resolve.Click
GetIPInfo(txt_IPAddress.Text)
End Sub

Public Sub GetIPInfo(ByVal IP As String)
Dim resolver As New XmlUrlResolver()
Dim myUri As New Uri("http://freegeoip.appspot.com/xml/" & IP)
Dim s As Stream = DirectCast(resolver.GetEntity(myUri, Nothing, GetType(Stream)), Stream)
' Construct a reader using the Stream object.
Dim xmlTextReader As New XmlTextReader(s)

Dim xdoc1 As New XmlDataDocument()
xdoc1.DataSet.ReadXml(xmlTextReader, XmlReadMode.Auto)

Dim ds As DataSet = xdoc1.DataSet
'DG_LiveRates.DataSource = xdoc1.DataSet;
'DataSet ds = new DataSet();
Dim dt As DataTable = ds.Tables(0)
DG_IPInfo.DataSource = dt
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lbl_myip.Text = GetIP.GetExternalIp()
End Sub
End Class

Sorry pentru treaba cu " ping www.rstcenter.com " era doar pentru demonstratie , am pus consola CMD peste date .

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...