Connecting Tech Pros Worldwide Forums | Help | Site Map

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

bushi
Guest
 
Posts: n/a
#1: Apr 2 '07
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.


Karthik D V [C#,ASP.NET - MCAD]
Guest
 
Posts: n/a
#2: Apr 2 '07

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


Request.UserHostAddress - will get you the ip address of the client
machine.
Request.Url - using this you can get webpage

bushi wrote:
Quote:
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.
Nicholas Paldino [.NET/C# MVP]
Guest
 
Posts: n/a
#3: Apr 2 '07

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


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]
- mvp@spam.guard.caspershouse.com

"bushi" <bushras84@gmail.comwrote in message
news:1175509408.861687.124760@q75g2000hsh.googlegr oups.com...
Quote:
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.
>

Mark Rae
Guest
 
Posts: n/a
#4: Apr 2 '07

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


"Nicholas Paldino [.NET/C# MVP]" <mvp@spam.guard.caspershouse.comwrote in
message news:u3uUr3SdHHA.4684@TK2MSFTNGP06.phx.gbl...
Quote:
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...


Peter Duniho
Guest
 
Posts: n/a
#5: Apr 2 '07

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


On Mon, 02 Apr 2007 07:10:43 -0700, Mark Rae <mark@markNOSPAMrae.com>
wrote:
Quote:
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
Peter Duniho
Guest
 
Posts: n/a
#6: Apr 2 '07

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


On Mon, 02 Apr 2007 06:53:51 -0700, Nicholas Paldino [.NET/C# MVP]
<mvp@spam.guard.caspershouse.comwrote:
Quote:
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
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
 
Posts: n/a
#7: Apr 3 '07

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


bushi wrote:
Quote:
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
bushi
Guest
 
Posts: n/a
#8: Apr 3 '07

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


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:
Quote:
bushi wrote:
Quote:
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

RobinS
Guest
 
Posts: n/a
#9: Apr 4 '07

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


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

Robin S.
------------------------
"bushi" <bushras84@gmail.comwrote in message
news:1175589009.589200.143220@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:
Quote:
bushi wrote:
Quote:
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


PFC Sadr
Guest
 
Posts: n/a
#10: Apr 4 '07

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


I'm contributing to this thread; STFU bitch



On Apr 3, 10:12 pm, "RobinS" <Rob...@NoSpam.yah.nonewrote:
Quote:
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:1175589009.589200.143220@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:
>
>
>
Quote:
bushi wrote:
Quote:
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.
>
Quote:
Other have answered about the IP address.
>
Quote:
You can translate from IP address to country with
a 90-99% accuracy using an IP geo database.
>>
Quote:
If you need C# code to load theese databases and lookup an IP just
drop a note, because I have something on the shelf.
>
Quote:
You can also buy the service and get higher accuracy - Akamai
offers that service.
>
Quote:
Arne- Hide quoted text -
>
- Show quoted text -

Closed Thread