Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get IP address / hostname from asp.net page

Status
Not open for further replies.

markknowsley

Programmer
Aug 30, 2005
152
0
0
GB
Is it possible to write some C# that will pick up the ip address / hostname of the user who is accessing the web form?
 
This article has a lot of information on tracking users to your site.

Read further down the page for the explanation regarding ASP.Net rather than logs.

(Note, this is in VB.Net, but can easily be converted)




----------------------------------------

TWljcm8kb2Z0J3MgIzEgRmFuIQ==
 
Just FYI, getting the host name at runtime can cause your application to fail if the DNS lookup fails.

It is much better to log the IP and look it up later, when the user isn't waiting for your page to respond.

Brian Begy
BugSentry - Automatic error reporting for .NET and COM
 
Which could also not be very helpful in case they use DHCP [bigglasses]. It would help to track it only per session.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top