Go4Expert (http://www.go4expert.com/)
-   ASP.NET (http://www.go4expert.com/forums/asp-net/)
-   -   How to fetch User's IP Address (http://www.go4expert.com/forums/fetch-users-ip-address-t26681/)

kanetkar.rucha@gmail 13Sep2011 10:48

How to fetch User's IP Address
I want User's IP Address stored in my access database and it showed in my website when user use my feedback page.
I want to display message to user ("Your IP Address Is :")
My site is built in ASP.NET (C#) and database in in Access.
Please help me and send me the detailed code and where it to put on page.
:worried::worried::worried: Thanks in advanced
Please somebody help me

shabbir 13Sep2011 10:56

Re: How to fetch User's IP Address
Moved to ASP forum.

bzforum 28May2012 21:29

Re: How to fetch User's IP Address
You can use this code
PHP Code:



PHP Code:


hope it helped..

alia123 12Feb2016 13:47

Re: How to fetch User's IP Address
The following snippet gets the IP address of the machine from which the client visited the website.


string ipaddress;

ipaddress = Request.ServerVariables["HTTP_X_FORWARDED_FOR"];

if (ipaddress == "" || ipaddress == null)

    ipaddress = Request.ServerVariables["REMOTE_ADDR"];


Dim ipaddress As String

ipaddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")

If ipaddress = "" Or ipaddress Is Nothing Then

  ipaddress = Request.ServerVariables("REMOTE_ADDR")

End If

All times are GMT +5.5. The time now is 21:10.