473,322 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

how to get the ip address & country of the webpage visitor

hi everyone!
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.

Apr 2 '07 #1
9 2457
Request.UserHostAddress - will get you the ip address of the client
machine.
Request.Url - using this you can get webpage

bushi wrote:
hi everyone!
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.
Apr 2 '07 #2
Karthik pointed out how you can get the IP address. However, trying to
get the country is at best going to be a best guess, as there is nothing to
correlate an IP address and the physical location it came from.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"bushi" <bu*******@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
hi everyone!
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.

Apr 2 '07 #3
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:u3**************@TK2MSFTNGP06.phx.gbl...
Karthik pointed out how you can get the IP address. However, trying to
get the country is at best going to be a best guess, as there is nothing
to correlate an IP address and the physical location it came from.
Indeed, and spoofing an IP address is so easy anyway that it's hardly worth
doing any of this...
Apr 2 '07 #4
On Mon, 02 Apr 2007 07:10:43 -0700, Mark Rae <ma**@markNOSPAMrae.com>
wrote:
Indeed, and spoofing an IP address is so easy anyway that it's hardly
worth doing any of this...
Surely you meant to write "it's hardly worth doing any of this as a
security measure".

Most people do NOT spoof their IP address and thus there are lots of good
uses to knowing the country or even the city where a user is likely
located from.

Pete
Apr 2 '07 #5
On Mon, 02 Apr 2007 06:53:51 -0700, Nicholas Paldino [.NET/C# MVP]
<mv*@spam.guard.caspershouse.comwrote:
Karthik pointed out how you can get the IP address. However, trying
to get the country is at best going to be a best guess, as there is
nothing to correlate an IP address and the physical location it came
from.
That's not exactly true. It's true that there is no guarantee that a
given IP address corresponds to a give geographical location. However, IP
addresses are correlated to geographical locations by a wide variety of
hosts (web sites for the most part), and generally with good success.

I'm not aware of any convenient way to do it in .NET, but it is possible
and the technology isn't exactly arcane.

Pete
Apr 2 '07 #6
bushi wrote:
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.
Other have answered about the IP address.

You can translate from IP address to country with
a 90-99% accuracy using an IP geo database.

Free such exist:
http://ip-to-country.webhosting.info/
http://www.maxmind.com/app/geoip_country

If you need C# code to load theese databases and lookup an IP just
drop a note, because I have something on the shelf.

You can also buy the service and get higher accuracy - Akamai
offers that service.

Arne
Apr 3 '07 #7
thanks for replying,plz send the C# code to me,it may be helpfull to
me.

On Apr 3, 6:30 am, Arne Vajhøj <a...@vajhoej.dkwrote:
bushi wrote:
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.

Other have answered about the IP address.

You can translate from IP address to country with
a 90-99% accuracy using an IP geo database.

Free such exist:
http://ip-to-country.webhosting.info/
http://www.maxmind.com/app/geoip_country

If you need C# code to load theese databases and lookup an IP just
drop a note, because I have something on the shelf.

You can also buy the service and get higher accuracy - Akamai
offers that service.

Arne

Apr 3 '07 #8
Ask a question here, get an answer here. The newsgroups are for everyone's
benefit, not for yours alone.

Robin S.
------------------------
"bushi" <bu*******@gmail.comwrote in message
news:11**********************@q75g2000hsh.googlegr oups.com...
thanks for replying,plz send the C# code to me,it may be helpfull to
me.

On Apr 3, 6:30 am, Arne Vajhøj <a...@vajhoej.dkwrote:
bushi wrote:
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.

Other have answered about the IP address.

You can translate from IP address to country with
a 90-99% accuracy using an IP geo database.

Free such exist:
http://ip-to-country.webhosting.info/
http://www.maxmind.com/app/geoip_country

If you need C# code to load theese databases and lookup an IP just
drop a note, because I have something on the shelf.

You can also buy the service and get higher accuracy - Akamai
offers that service.

Arne


Apr 4 '07 #9
I'm contributing to this thread; STFU bitch

On Apr 3, 10:12 pm, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Ask a question here, get an answer here. The newsgroups are for everyone's
benefit, not for yours alone.

Robin S.
------------------------"bushi" <bushra...@gmail.comwrote in message

news:11**********************@q75g2000hsh.googlegr oups.com...
thanks for replying,plz send the C# code to me,it may be helpfull to
me.

On Apr 3, 6:30 am, Arne Vajhøj <a...@vajhoej.dkwrote:
bushi wrote:
i want to get the ipaddress,and the country name of a webpage
visitor,using asp.Net(C#).if anyone knows about it,plz rply me.
thanx in advance.
Other have answered about the IP address.
You can translate from IP address to country with
a 90-99% accuracy using an IP geo database.
Free such exist:
http://ip-to-country.webhosting.info/
http://www.maxmind.com/app/geoip_country
If you need C# code to load theese databases and lookup an IP just
drop a note, because I have something on the shelf.
You can also buy the service and get higher accuracy - Akamai
offers that service.
Arne- Hide quoted text -

- Show quoted text -

Apr 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: abracad | last post by:
Hi Is there any (preferably free) PHP script that will identify the country of a visitor, thus allowing one page to be delivered to those from A, B and C, and another to those from X, Y and Z? ...
5
by: JustSomeGuy | last post by:
I've seen web pages that show you your IP address when you connect to their site.. Can someone point me to the html/java/php (whatever) that does this? I'd like to display this to my users when...
3
by: arun32581 | last post by:
I am developing a page for Mozilla/IE which reads xml data and when the link on the page is clicked it displays the data as a table. The display is controlled by a Javascript. Everything works...
8
by: Nicole | last post by:
Hi I need to be able to change the currency and some form fields displayed on my website depending on where the visitor is based. I don't need a fully functional cart, just a kinda either...
4
by: Arun | last post by:
Like its possible to find IP address of a visitor in same way is it possible to find the visitor's PC's MAC address? -Regards,
13
by: bushi | last post by:
hi everyone! i want to get the ipaddress,and the country name of a webpage visitor,using asp.Net(C#).if anyone knows about it,plz rply me. thanx in advance.
4
by: kang jia | last post by:
hi i am doing mailinglist currently. the code in my first page is like this : : <html> <head> <link rel="stylesheet" type="text/css" href="gallery.css" /> <script language="JavaScript"> ...
2
by: =?Utf-8?B?YW1ndQ==?= | last post by:
Hello I am looking for a asp.net code so that we can incorporate the code which can help us to retrive the country and other infromation through IP address of the visitor for the website. amgu
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.