.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

How find IP address of the client in ASP.net

Posted By: Kshitish     Posted Date: August 06, 2008    Points:2   Category :ASP.Net
Hi,

I want to get the IP Address of the client in asp.net. Please help me.

Kshitish

Responses
Author: Pankaj Mishra             
Posted Date: August 06, 2008     Points: 5   

Hi,

You can get the client IP Address from the Request Object's UserHostAddress property.Try like this

eg.

string clientIP = Request.UserHostAddress;



Cheers
Pankaj

Author: Amit Mehra             
Posted Date: October 04, 2008     Points: 5   

Yes Pankaj is right

Thanks,
Amit
Please "Mark As Answer " if this post help you.
Author: Rahul             
Posted Date: October 26, 2008     Points: 5   

Hi,
Yes Pankaj code is working

Author: Lalij Mer             
Posted Date: January 07, 2010     Points: 5   

try this code


string ipAddress = Request.ServerVariables ["REMOTE_ADDR"];
string ipAddress2 = Request.UserHostAddress;


also check this link
http://www.aspxcode.net/free-asp-net-sample-source-code-c.aspx?Topics=How%20to%20Get%20the%20client%20IP%20address

Please Check my answer if you help....
Thank You...

Lalit.
Author: Hosana             
Posted Date: May 12, 2010     Points: 5   

In order to find the Ip address make use of this site http://www.whoisxy.com/ & find out the solution ..
It provide information at free cost..

Author: Dhivakaran             
Posted Date: November 23, 2010     Points: 5   

you can get using below codes
this.Page.Request.ServerVariables["REMOTE_ADDR"];

-
Dhivakaran T
Author: Raj             
Posted Date: December 14, 2010     Points: 5   

I want to get the IP Address of the client in asp.net. Please help me.



string clientIP = Request.UserHostAddress;




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend