Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[TuT] Get User Infomation (IP/ISP/PORT/PROXY/BROWSER ETC)

Again another share for me :)

Just define under 'Pulblic Class Form1' The Strings

So with:
Code
getuserinfo = nav.Select("//remote_port")
    While (getuserinfo.MoveNext())
    RemotePort = (getuserinfo.Current.Value)
    End While

You define
Code
Dim RemotePort As String

And e.g in Form1.Load
Code
YourIP()
Label1.text = RemotePort

Label1.text will show e.g = '55068'

Whole code:
Code
Imports System.Xml.XPath

Private Sub YourIP()
  Try
    Dim doc As XPathDocument
    doc = New XPathDocument("http://ip-address.domaintools.com/myip.xml")
    Dim nav As XPathNavigator
    nav = doc.CreateNavigator()
    Dim Data As XPathExpression = nav.Compile("//ip_address")
    Dim getuserinfo As XPathNodeIterator = nav.Select(Data)
    While (getuserinfo.MoveNext())
    Ip = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//connection")
    While (getuserinfo.MoveNext())
    Connection =  (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//remote_port")
    While (getuserinfo.MoveNext())
    RemotePort = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//proxy_type")
    While (getuserinfo.MoveNext())
    ProxyType = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//user_agent")
    While (getuserinfo.MoveNext())
    UserAgent = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//hostname")
    While (getuserinfo.MoveNext())
    Hostname = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//country")
    While (getuserinfo.MoveNext())
    Country = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//region")
    While (getuserinfo.MoveNext())
    Region = (getuserinfo.Current.Value)
    'End While

    getuserinfo = nav.Select("//isp")
    While (getuserinfo.MoveNext())
    ISP = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//city")
    While (getuserinfo.MoveNext())
    City = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//country_flag")
    While (getuserinfo.MoveNext())
    PictureBox1.ImageLocation = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//protocol")
    While (getuserinfo.MoveNext())
    Protocol = (getuserinfo.Current.Value)
    End While

  Catch ex As Exception

  End Try
    End Sub

Enjoy!
FR1908
Thanks Nicee Tuto nice share. :D
(Apr 15, 2010 12:09 PM)Leoopardss Wrote:  Thanks Nicee Tuto nice share. :D

No problem thanks for replying :)
FR1908
Sorry not realy working , can i add you on MSN?
PM me plz ..
Always PM me for business inquiries.
(May 2, 2010 06:51 AM).Nielz Wrote:  Sorry not realy working , can i add you on MSN?
PM me plz ..


Yes, but this is working lol.
FR1908
thx for sharing
toshrt
(May 8, 2010 09:46 AM)rapidguide Wrote:  thx for sharing
toshrt

No problem mate :D
FR1908
thanks for this grate tutorial man...
PHP & .NET Contributor.
Hm I got 13 non declared errors Please PM me.
You should group every piece of code that gets info inside its own Try...Catch. That way, unlike your code above, all will not fail when one thing goes wrong.
Fixed
Code
Imports System.Xml.XPath
Public Class Form1
    Dim datetime, ip, Connection, RemotePort, ProxyType, UserAgent, Hostname, Country, Region, ISP, City, Protocol, language As String
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  Try
    Dim doc As XPathDocument
    doc = New XPathDocument("http://ip-address.domaintools.com/myip.xml")
    Dim nav As XPathNavigator
    nav = doc.CreateNavigator()
    Dim Data As XPathExpression = nav.Compile("//ip_address")
    Dim getuserinfo As XPathNodeIterator = nav.Select(Data)
    While (getuserinfo.MoveNext())
    Ip = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//date")
    While (getuserinfo.MoveNext())
    Datetime = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//connection")
    While (getuserinfo.MoveNext())
    Connection = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//remote_port")
    While (getuserinfo.MoveNext())
    RemotePort = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//proxy_type")
    While (getuserinfo.MoveNext())
    ProxyType = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//user_agent")
    While (getuserinfo.MoveNext())
    UserAgent = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//hostname")
    While (getuserinfo.MoveNext())
    Hostname = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//country")
    While (getuserinfo.MoveNext())
    Country = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//region")
    While (getuserinfo.MoveNext())
    Region = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//isp")
    While (getuserinfo.MoveNext())
    ISP = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//city")
    While (getuserinfo.MoveNext())
    City = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//protocol")
    While (getuserinfo.MoveNext())
    Protocol = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//language")
    While (getuserinfo.MoveNext())
    Language = (getuserinfo.Current.Value)
    End While

    getuserinfo = nav.Select("//country_flag")
    While (getuserinfo.MoveNext())
    PictureBox1.ImageLocation = (getuserinfo.Current.Value)
    End While
    Label1.Text = "Ip : " + ip
    Label2.Text = "Connection : " + Connection
    Label3.Text = "RemotePort : " + RemotePort
    Label4.Text = "ProxyType : " + ProxyType
    Label5.Text = "UserAgent : " + UserAgent
    Label6.Text = "Hostname : " + Hostname
    Label7.Text = "Country : " + Country
    Label8.Text = "Region : " + Region
    Label9.Text = "ISP : " + ISP
    Label10.Text = "City : " + City
    Label11.Text = "Protocol : " + Protocol
    Label12.Text = "Datetime : " + datetime
    Label13.Text = "language : " + language
  Catch ex As Exception
  End Try
    End Sub
End Class


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Java] by explodeviews97Sep 16, 2016 04:29 AM 6 183 Sep 16, 2016 04:29 AM
Last Post: Sakuto
[.NET] by infomihoMar 17, 2014 02:05 AM 89 3,398 Mar 17, 2014 02:05 AM
Last Post: programtesting28
[.NET] by IngenuityOct 20, 2013 05:17 PM 27 1,428 Oct 20, 2013 05:17 PM
Last Post: Ingenuity