Visitor Counter Filter

  • Thread starter Thread starter Samuel Shulman
  • Start date Start date
S

Samuel Shulman

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 said:
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;
}
 
Back
Top