How can get the user’s country name using IP address in Classic ASP and Javascript?
http://www.webservicex.net provides web services for get the country name based on ip address.
In ASP using javascript we can achieve the task.
Step1 : Refer the webservice using SOAPClient object
var strUrlForwebservicex = http://www.webservicex.net/geoipservice.asmx?wsdl
var objSoapClient = Server.CreateObject(‘MSSOAP.SoapClient30’)
objSoapClient.ClientProperty(“ServerHTTPRequest”) = true;
objSoapClient.MSSoapInit(strUrlForwebservicex);
Step2 : Get user’s IP address
var strIPAddress = Request.ServerVariables(“REMOTE_ADDR”);
Step3 : Pass the parametes on GetGeoIP webmethod
var strCountryName =objSoapClient.GetGeoIP(strIPAddress);
Complete Script :
<%
var strUrlForwebservicex = “http://www.webservicex.net/geoipservice.asmx?wsdl”
var objSoapClient = Server.CreateObject(‘MSSOAP.SoapClient30’)
objSoapClient.ClientProperty(“ServerHTTPRequest”) = true;
try
{
objSoapClient.MSSoapInit(strUrlForwebservicex);
objSoapClient.ConnectorProperty(“ConnectTimeout”) = 600000;
var strIPAddress = Request.ServerVariables(“REMOTE_ADDR”);
var strCountryName =objSoapClient.GetGeoIP(strIPAddress);
if (strCountryName == “RESERVED”)
{
strCountryName = “”;
}
}
catch (e)
{
strCountryName = “”;
Response.Write(“Following error messages occured : ” + e.message)
}
%>
sdsd
how to get “MSSOAP.SoapClient30”.?
Hi Lee,
You can get from here.
http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-CEEC-4088-9753-86F052EC8450&displaylang=en
DMW Technologies (P) Limited launcher an API to extract all possible information from any IP. You can sign up for free for the API at http://geoip.dmwtechnologies.com
We call it IP Intelligence. It is an open source API which can determine country, state/region, city, US area code, metro code, latitude, and longitude information for IP addresses worldwide. You can download the free sample code in PHP5
GeoIP is a easy to use API to extract all possible information from the IP address. GeoIP API is Technology, Language and Platform independent. This means you can use it in any program, any application or any language.
Allow me to demonstrate how simple it is to use it:
Usage:
http://geoip.dmwtechnologies.com/api.php?apikey=YOUR_API_KEY_HERE&ip=ANY_IP_ADDRESS
Example:
http://geoip.dmwtechnologies.com/api.php?apikey=dgsdge734hdfhs644w3yehyw34yy34y&ip=214.25.34.12
You can get your FREE API KEY in less than 5 minutes. The Free account enables you to extract the country from IP address. One can also extract other vital information for the IP like City, Longitude, Latitude etc by upgrading to the premium account for a small fee .The details of our premium packages are as follows:
$15 for 50,000 IPs
$30 for 125,000 IPs
$50 for 250,000 IPs
$90 for 500,000 IPs
$120 for 750,000 IPs
Thank you very much. It does help. I will update with how I am getting on…
انجام پروژه های مهندسی نرم افزار در تمامی سطوح
http://www.bitasoft.ir
Hi
know any webservice for getting the client machine id
I am not sure about webservice.
But you can use C# coding for getting windows attributes from client machine.
I hope this will helpful to you
http://blog.xploiter.com/c-and-aspnet/get-your-local-machinecomputer-name-in-c/
In the above ASP code, Do u need to mention the script language…
I am not able to run it.. Can you please help…
Yes you should specify the script language in your ASP page.
In this page i am using Javascript. So we need to place the
below tags in asp file
Очень понравилось, даже не ожидала.
Вы производите обмен постовыми?
здесь видел ет gamebulletin.ru
Thanks, I’ve been looking for a service like this for awhile now.
Welcome Joe
Download clip , music , pictures
hi, i got solution. its very easy to get the country ip addr. very very simple
http://www.onlineatoz.net/onlineatoznet/forum/post/IP-Address-Overview-in-aspnet.aspx
qbagoonezcci
Post your ads for absolute free. No cost. you can edit / remove your ads if you do not want them or need edition.
It is really a good resource
Is there is any free website which provide you a control to edit/remove your ads for free .. no ther is no-one. Go to http://w3sale.com you find it 100% free service.
umm… I am not
Good article, i want to share with my friends..
Hi balanagaraj,
Thanks for the script. I pasted the script in location.asp and replaced the ASP <% sign with the but I am getting the error Server is undefined at line
var objSoapClient = Server.CreateObject(‘MSSOAP.SoapClient30’)
Is there anything which I am mising
Wow, wonderful weblog layout! How lengthy have you
ever been blogging for? you make blogging look easy. The
overall look of your site is excellent, let
alone the content material!
Appreciating the time and energy you put into your site and detailed information you present. It’s good to come across a blog every once in a while that isn’t the same outdated rehashed material. Wonderful read! I’ve bookmarked your site and I’m including your RSS feeds to my Google account.
Asking questions are in fact pleasant thing if you are not understanding anything fully, but this article presents nice understanding yet.