How To Find Web Site Visitor IP Address?
To find IP address of web site visitor, you can use this code:
[ C# ]
string VisitorIPAddress = Request.UserHostAddress.ToString();
[ VB.NET ]
Dim VisitorIPAddress As String = Request.UserHostAddress.ToString()
Or, you can use REMOTE_ADDR from ServerVariables collection, with code snippet like this:
[ C# ]
string VisitorIPAddress = Request.ServerVariables["REMOTE_ADDR"];
[ VB.NET ]
Dim VisitorIPAddress As String = Request.ServerVariables("REMOTE_ADDR")
Related articles:
1. XmlDataSource Control
2. Using ASP.NET With SQL Server
3. How To Convert Text Box Value To Integer?
Copyright © 2002-2008 Bean Software. All rights reserved.