62,046
社区成员
发帖
与我相关
我的任务
分享
if(!Ispostback)
{
//更新数据库中记录次数的字段
}
//增加点击量
private void AddClickCount() {
try
{
if (Session["UserHostIP"].ToString() != Request.UserHostAddress.ToString() || Session["RequestID"].ToString() != Request.QueryString["id"].ToString())
{
string strSql = "Update T_MainInfo Set ClickCount=ClickCount+1 Where id=" + Request.QueryString["id"].ToString();
bc.ExecSQL(strSql);
Session["UserHostIP"] = Request.UserHostAddress.ToString();
Session["RequestID"] = Request.QueryString["id"].ToString();
}
}
catch {
string strSql = "Update T_MainInfo Set ClickCount=ClickCount+1 Where id=" + Request.QueryString["id"].ToString();
bc.ExecSQL(strSql);
Session["UserHostIP"] = Request.UserHostAddress.ToString();
Session["RequestID"] = Request.QueryString["id"].ToString();
}
}