473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Getting the IP address of the client PC

Is there a way to get the IP address of the person who is accessing your web
page?

Any help is greatly appreciated.
Nov 18 '05 #1
6 1440
"Greg Smith" <gj*@umn.edu> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Is there a way to get the IP address of the person who is accessing your web page?

Any help is greatly appreciated.


Investigate Request.ServerVariables - it's in the HttpContext.Current
namespace. Specifically, REMOTE_ADDR & REMOTE_HOST
Nov 18 '05 #2
Request.ServerVariables should get you what you need.
Mind you if they are behind a NAT or IP Mask/Proxy you will get that IP.

--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Greg Smith" <gj*@umn.edu> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Is there a way to get the IP address of the person who is accessing your
web
page?

Any help is greatly appreciated.

Nov 18 '05 #3
Try using Request.ServerVariables["REMOTE_ADDR"]

"Greg Smith" <gj*@umn.edu> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Is there a way to get the IP address of the person who is accessing your web page?

Any help is greatly appreciated.

Nov 18 '05 #4
All of the solutions you've been presented with work. However, IP addresses
on the Internet change frequently as a rule. Don't expect each user to
return with the same IP address, unless you are working on a LAN.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Greg Smith" <gj*@umn.edu> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Is there a way to get the IP address of the person who is accessing your web page?

Any help is greatly appreciated.

Nov 18 '05 #5
Request.UserHostAddress
Eliyahu

"Greg Smith" <gj*@umn.edu> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Is there a way to get the IP address of the person who is accessing your web page?

Any help is greatly appreciated.

Nov 18 '05 #6
"Eliyahu Goldin" <re*************@monarchmed.com> skrev i en meddelelse
news:eb**************@TK2MSFTNGP10.phx.gbl...
Request.UserHostAddress


And in addition, Request.UserHostName will do a reverse DNS to get the name
of the client machine.

/Jens

--
Jens Christian Mikkelsen
http://www.jcmikkelsen.dk
Nov 18 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chris | last post by:
<apologies for cross-posting> Hi All, I am based in the UK and have been doing some private work for a client which involved setting up a database and scripts to search it and display results...
3
by: roger beniot | last post by:
I would like to figure out how to detect an IP address change for an XP/Win2K3 machine that is leasing an IP via DHCP (and do it in C#)... Is there any event that indicates an IP address...
5
by: Greg Smith | last post by:
I have been using the following to get the client IP address: Request.ServerVariables All of a sudden it has started returning 127.0.0.1 all the time. Does anybody have any idea why this...
4
by: anonymous_c | last post by:
Hey guys. I'm creating a file transfer app. Anyways, I'm using this code... SERVER <code>Dim Hostname As String = Dns.GetHostName Dim IP As String =...
4
by: Andy | last post by:
Hi all, I'm trying to write some code in a business layer which will audit the IP address that the request is coming from. If the business layer is being called from a web app, I'd like to get...
14
by: Ankit Aneja | last post by:
The code of classes given below is for server to which clients connect i want to get ip address of client which has connected pls help how can i get //listen class public class listen {
6
by: Prabhat | last post by:
Hi Friends, It it possible to get the MAC Address of the client PC using ASP. Also can I get the HDD ID/Serial Number also using asp? Please advice. Thanks Prabhat
4
by: Macca | last post by:
Hi, I am using an asynchronous socket server to allow comms between multiple clients and my server. I know how to obtain the IPAddress of the client (network device) as shown below :- string...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
29
pradeepjain
by: pradeepjain | last post by:
Hii, I need to know is there any way to get the mac id's of the machines accessing ma site! I want to make a access lock using the mac id's <?php function returnmacaddress() { //...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.