Re: Visitor Counter Filter
- From: "Fred Exley" <fexley221@xxxxxxx>
- Date: Sun, 26 Nov 2006 09:24:13 -0800
"Samuel Shulman" <samuel.shulman@xxxxxxxxxxxx> wrote in message
news:uQwO8DWEHHA.4256@xxxxxxxxxxxxxxxxxxxxxxx
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;
}
.
- References:
- Visitor Counter Filter
- From: Samuel Shulman
- Visitor Counter Filter
- Prev by Date: Re: DataRow Delete Method
- Next by Date: Re: When do I need to run "aspnet_regiis -i"?
- Previous by thread: Visitor Counter Filter
- Next by thread: Help on VWD2005 - beginer problem
- Index(es):
Relevant Pages
|