Getting user information...

Discussion in 'ASP .Net' started by RAB, Nov 18, 2007.

  1. RAB

    RAB Guest

    When an anonymous user visits my website what basic information can I
    gather about them? I thought I read somewhere that I could get the
    name of the server that is requesting my website http code? If this
    is the case what would be some VB code code to capture this
    information in a string variable?

    Thanks in advance,
    RABMissouri2007
     
    RAB, Nov 18, 2007
    #1
    1. Advertising

  2. On Nov 18, 6:21 pm, RAB <> wrote:
    > When an anonymous user visits my website what basic information can I
    > gather about them? I thought I read somewhere that I could get the
    > name of the server that is requesting my website http code? If this
    > is the case what would be some VB code code to capture this
    > information in a string variable?
    >
    > Thanks in advance,
    > RABMissouri2007


    You can get the client IP address, name of the browser (User-Agent)
    and a previous site visited by the user, that linked to your site
    (Referrer).

    ' IP Address
    _UserHostAddress =
    HttpContext.Current.Request.UserHostAddress.ToString

    ' Browser
    _UserAgent = HttpContext.Current.Request.UserAgent.ToString

    ' Referrer
    _Referrer = HttpContext.Current.Request.UrlReferrer.ToString
     
    Alexey Smirnov, Nov 18, 2007
    #2
    1. Advertising

  3. "Alexey Smirnov" <> wrote in message
    news:...

    > client IP address
    > HttpContext.Current.Request.UserHostAddress.ToString


    So easily spoofed (via proxies or other methods) these days...

    > name of the browser (User-Agent)
    > HttpContext.Current.Request.UserAgent.ToString


    Several browsers are now capable of pretending to be different browsers...

    > previous site visited by the user, that linked to your site
    > HttpContext.Current.Request.UrlReferrer.ToString


    More and more ISPs are stripping this off...

    Not really worth bothering with...


    --
    Mark Rae
    ASP.NET MVP
    http://www.markrae.net
     
    Mark Rae [MVP], Nov 18, 2007
    #3
    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. z. f.
    Replies:
    0
    Views:
    685
    z. f.
    Feb 3, 2005
  2. subrato
    Replies:
    8
    Views:
    918
    Juan T. Llibre
    Mar 14, 2006
  3. clercmedia
    Replies:
    2
    Views:
    32,312
    clercmedia
    Dec 9, 2005
  4. Replies:
    2
    Views:
    342
    Mark Hertel
    Jun 30, 2004
  5. lerenard001
    Replies:
    0
    Views:
    425
    lerenard001
    Jul 7, 2008
Loading...

Share This Page