Getting IP address

K

KatMagic

I have an asp.net 1.1 application on our internal web server that logs when
a user logs in and records the ipaddress; however, it is returning the
address of the server, not the user's workstation. How would I get the
user's workstation's ip address, if possible. This is what I'm using now

Dim ip as string
Try
Dim strHostName as String = dns.GetHostName
Dim ipEntry as IPHostEntry = dns.GetHostByName(strHostName)
Dim ipAddress as IPAddress() = ipEntry.AddressList
Dim i as Integer = 0
do while i < ipAddress.Length
ip = ip & " " & i & ": " & strHostName & " " &
IpAddress(i).ToString
i = i+1
Loop
Catch ex as Exception
End try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top