Use the below free web-service to get the country name using IP Address.
http://www.webservicex.net/geoipservice.asmx?wsdl
Add the service to your web or windows application and name the service
as say for eg. locationFinder
Now access it in your code as
// Create instance for the service
LocationFinder.GeoIPService service = new LocationFinder.GeoIPService();
// Gets the country name.
string country = service.GetGeoIP("216.241.xxx.xx").CountryName;
To get the ipAddress of the Client machine use
String ipAddress = Request.UserHostAddress.ToString();
1 comment:
It is creating problem for anonymous users.Do you have any idea for this?
Post a Comment