Getting IP address of visitor?

Discussion in 'ASP .Net' started by brett, Nov 7, 2006.

  1. brett

    brett Guest

    How can I get the IP address of a visitor to my site in ASP.NET 2.0?
    Please include the full namespace.

    Thanks,
    Brett
    brett, Nov 7, 2006
    #1
    1. Advertising

  2. brett

    JosephByrns Guest

    Request.UserHostAddress

    "brett" <> wrote in message
    news:...
    > How can I get the IP address of a visitor to my site in ASP.NET 2.0?
    > Please include the full namespace.
    >
    > Thanks,
    > Brett
    >
    JosephByrns, Nov 7, 2006
    #2
    1. Advertising

  3. Hi,
    string ip=HttpContext.Current.Request.UserHostAddress;

    Regards,
    Mohamed Mosalem

    "brett" wrote:

    > How can I get the IP address of a visitor to my site in ASP.NET 2.0?
    > Please include the full namespace.
    >
    > Thanks,
    > Brett
    >
    >
    =?Utf-8?B?TW9oYW1lZCBNb3NhbGVt?=, Nov 7, 2006
    #3
  4. brett

    Mark Rae Guest

    "brett" <> wrote in message
    news:...

    > How can I get the IP address of a visitor to my site in ASP.NET 2.0?
    > Please include the full namespace.


    In addition to the replies you've already received, you simply cannot place
    any trust whatsoever that the IP address being reported is genuine.

    It is the simplest thing in the world to spoof an IP address...
    Mark Rae, Nov 7, 2006
    #4
  5. brett

    Guest

    Mark Rae wrote:

    > It is the simplest thing in the world to spoof an IP address...


    Like this.
    , Nov 7, 2006
    #5
  6. brett

    Mark Rae Guest

    <> wrote in message
    news:...

    >> It is the simplest thing in the world to spoof an IP address...

    >
    > Like this.


    A quick inspection of the message properties of this post and the before the
    previous one will tell you that they are from an IP address in London.

    But the one in the middle looks as if it's come from Wilmington, Delaware...

    I assure you it hasn't...

    This really is so easy to do that capturing the IP address of incomg
    requests to a website is almost not worth the bother...
    Mark Rae, Nov 7, 2006
    #6
  7. brett

    brett Guest

    > This really is so easy to do that capturing the IP address of incomg
    > requests to a website is almost not worth the bother...


    Well, I'm just trying to keep some javascript tracking code from
    tracking my IP, which I won't be spoofing. I'm guessing it should work
    fine in that case. The IP doesn't change.

    Thanks,
    Brett
    brett, Nov 7, 2006
    #7
  8. brett

    Mark Rae Guest

    "brett" <> wrote in message
    news:...

    > Well, I'm just trying to keep some javascript tracking code from
    > tracking my IP, which I won't be spoofing. I'm guessing it should work
    > fine in that case. The IP doesn't change.


    Er, so now you're looking for a way to *prevent* your IP address from being
    tracked by JavaScript code...?
    Mark Rae, Nov 7, 2006
    #8
  9. brett

    kpg Guest

    As Mark Rae once said in microsoft.public.dotnet.framework.aspnet

    > "brett" <> wrote in message
    > news:...
    >
    >> Well, I'm just trying to keep some javascript tracking code from
    >> tracking my IP, which I won't be spoofing. I'm guessing it should
    >> work fine in that case. The IP doesn't change.

    >
    > Er, so now you're looking for a way to *prevent* your IP address from
    > being tracked by JavaScript code...?


    Sounds like he doesn't want *his* visits tracked, just *real* visitors.

    Or is could be more insidious... :)
    kpg, Nov 7, 2006
    #9
  10. brett

    Mark Rae Guest

    "kpg" <> wrote in message
    news:Xns98749EEEF36CFipostthereforeiam@207.46.248.16...

    >>> Well, I'm just trying to keep some javascript tracking code from
    >>> tracking my IP, which I won't be spoofing. I'm guessing it should
    >>> work fine in that case. The IP doesn't change.

    >>
    >> Er, so now you're looking for a way to *prevent* your IP address from
    >> being tracked by JavaScript code...?

    >
    > Sounds like he doesn't want *his* visits tracked, just *real* visitors.


    Oh right - yes, I see what you mean now...

    In which case, it's dead easy, as the first two replies have described...

    > Or is could be more insidious... :)


    Let's give him the benefit of the doubt... :)
    Mark Rae, Nov 7, 2006
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shige
    Replies:
    1
    Views:
    801
    Munsifali Rashid
    Jan 13, 2004
  2. bushi
    Replies:
    13
    Views:
    1,547
    Juan T. Llibre
    Apr 22, 2007
  3. PP

    Visitor IP Address

    PP, Jan 6, 2010, in forum: ASP .Net
    Replies:
    1
    Views:
    380
    bruce barker
    Jan 6, 2010
  4. Morris Neuman

    Visitor's IP Address

    Morris Neuman, Jun 30, 2009, in forum: ASP .Net Web Controls
    Replies:
    4
    Views:
    806
    Morris Neuman
    Jul 2, 2009
  5. bush
    Replies:
    3
    Views:
    290
Loading...

Share This Page