C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Get A Visitor's IP Address In ASP.NET
WhatsApp
Pankaj Pandey
5y
22.1
k
0
8
25
Blog
Here a code snippet to find a visitor's IP address and URL. This code can be used in your ASP.NET page's code behind.
Code to get a visitor's IP address:
String ipAddress = System.Web.HttpContext.Current.Request.UserHostAddress;
Code to get URL:
string
url = Request.Url.AbsoluteUri;
Now you can manage logo or other managements through these information or can use ip address to find unique visitors on your site.
Here is a detailed tutorial,
Get IP Address In ASP.NET
.
Learn more here:
WebRequest and WebResponse Classes
Get User/Visitor IP Address and Domain nameURL called by User
People also reading
Membership not found