How do I show IP Address

TheWizardofInt

Well-known member
Joined
Dec 31, 1969
Messages
333
Location
Orlando, FL
I want to show the IP address of people visiting my site.

I tried this:

Code:
    Private Sub GetIp()
        Dim sString As String
        sString = System.Net.Dns.Resolve(System.Net.Dns.GetHostName()).AddressList(0).ToString()
        lblIP.Text = sString
    End Sub

But that shows the IP address OF my site
 
Never mind, this is it:

Code:
    Private Sub GetIp()
        Dim sString As String
        sString = Request.ServerVariables("REMOTE_ADDR")
        lblIP.Text = sString
    End Sub
 
Back
Top