Cybercrux

Everything is achievable through technology

IP of Visitor

Get ip of visiter
#region Get IP Function
///
/// Return the ip of visiter if no firewall blocking
///

///
public string GetVisitorIpAddress()
{
string IP = Request.ServerVariables[“REMOTE_HOST”].ToString();
return IP;
}
#endregion

Visitor couting
protected void Application_Start(object sender, EventArgs e)
{
//Session Count is intialized with 0.
Application[“SessionCount”] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{
Application.Lock();
int countSession = (int)Application[“SessionCount”];
Application[“SessionCount”] = countSession + 1;
Application.UnLock();
}
protected void Session_End(object sender, EventArgs e)
{
Application.Lock();
int countSession = (int)Application[“SessionCount”];
Application[“SessionCount”] = countSession – 1;
Application.UnLock();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s