Print Page | Close Window

Remote host lookup.

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: ASP.NET Discussion
Forum Description: Discussion and chat on ASP.NET related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=11876
Printed Date: 29 March 2026 at 10:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Remote host lookup.
Posted By: huwnet
Subject: Remote host lookup.
Date Posted: 20 September 2004 at 2:52pm
I am using the Remote_addr and the remote_host on an IP script in ASP.

However I was wondering what the equivalent was in asp.net



Replies:
Posted By: Mart
Date Posted: 20 September 2004 at 3:01pm
Dim IPAddress As String = Request.ServerVariables("REMOTE_ADDR")

i.e. the same as ASP


Posted By: huwnet
Date Posted: 20 September 2004 at 3:08pm
Is there anyway of doing remote host as on my shared hosting remote_addr and remote_host bring up the ip address as I cannot enable reverse dns on the asp remote_host script.


Posted By: Mart
Date Posted: 20 September 2004 at 3:10pm
You could either use

Dim IPAddress As String = Request.ServerVariables("REMOTE_ADDR")

Or if you are feeling a bit adventurous you could use the System.Net namespace to do a reverse DNS lookup


Posted By: michael
Date Posted: 20 September 2004 at 4:22pm
Those are all still for backward compability.
Use
Dim s As String = Request.UserHostAddress() to get the IP
Dim s As String = Request.UserHostName to get the DNS Hostname


-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: huwnet
Date Posted: 21 September 2004 at 11:34am
Thanks 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net