Visitor Counter Filter

Discussion in 'ASP .Net' started by Samuel Shulman, Nov 26, 2006.

  1. Hi

    I want to count the number of visitors to the website but exclude the visits
    by the office staff

    I currently use the SessionBegin event to count but how can I avoid the
    office staff to be counted


    Thank you,
    Samuel
    Samuel Shulman, Nov 26, 2006
    #1
    1. Advertising

  2. Samuel Shulman

    Fred Exley Guest

    "Samuel Shulman" <> wrote in message
    news:...
    > Hi
    >
    > I want to count the number of visitors to the website but exclude the
    > visits by the office staff
    >
    > I currently use the SessionBegin event to count but how can I avoid the
    > office staff to be counted
    >
    >
    > Thank you,
    > Samuel



    As a total amateur of web development, I welcome learning a better way, but
    here's my homespun method:

    public string determineRunLoc()
    {

    // .............................. write hit record
    ................................

    // get user ip address:
    HttpContext cx = HttpContext.Current;
    string requestorIPaddress = this.Context.Request.UserHostAddress;
    string firstPart = requestorIPaddress.Substring(0, 8);

    // exclude me locally or anybody at my ISP:
    if ((requestorIPaddress != "127.0.0.1") && (firstPart != "71.26.94"))
    {
    runLoc = "internet";

    // insert a hitfile record:
    hitFile newHit = new hitFile();
    string msgBack = newHit.insertHitRecord(this.Page.ToString(),
    requestorIPaddress);
    }
    else
    {
    runLoc = "local";
    }
    //
    ................................................................................

    return runLoc;
    }
    Fred Exley, Nov 26, 2006
    #2
    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. The Eeediot
    Replies:
    3
    Views:
    2,230
    =?Utf-8?B?UnVsaW4gSG9uZw==?=
    Dec 22, 2004
  2. George2
    Replies:
    1
    Views:
    797
    Alf P. Steinbach
    Jan 31, 2008
  3. W. Watson
    Replies:
    5
    Views:
    395
    Dotan Cohen
    Feb 12, 2008
  4. dorayme

    Client wants a visitor counter

    dorayme, Mar 25, 2008, in forum: HTML
    Replies:
    21
    Views:
    985
    dorayme
    Mar 29, 2008
  5. zax75
    Replies:
    1
    Views:
    1,096
Loading...

Share This Page