Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Remote host lookup.
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Remote host lookup.

 Post Reply Post Reply
Author
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Topic: Remote host lookup.
    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
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 20 September 2004 at 3:01pm
Dim IPAddress As String = Request.ServerVariables("REMOTE_ADDR")

i.e. the same as ASP
Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
huwnet View Drop Down
Senior Member
Senior Member


Joined: 30 May 2003
Location: England
Status: Offline
Points: 1375
Post Options Post Options   Thanks (0) Thanks(0)   Quote huwnet Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2004 at 11:34am
Thanks 
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.