在ASP.NET中防止同一台机器访问 浏览数增加

   if (!this.IsPostBack)
   {
    string JobID="";
    if (Request.QueryString["JobID"]==null)
    {
     this.Response.Write("<script language='javascript'>alert('非法操作');document.body.innerHtml = '非法操作';</script>");
     return;
    }
    JobID=this.Request.QueryString["JobID"].ToString();

    string sSessionJob = "Job"+this.Request.ServerVariables["REMOTE_HOST"];
    if (this.Session[sSessionJob] == null)
    {
     Session.Add(sSessionJob,JobID);
     string sqlupdatejob="update BZ_Data_Job set Tickcount=Tickcount+1 where JobID="+JobID+"";
     EYuanT.CommLib.clsDB.doGetDBManager().doAddRecord(sqlupdatejob,null);
    }
    string sqljob="select * from BZ_Data_Job where JobID="+JobID+"";
    System.Data.DataSet dsjob = EYuanT.CommLib.clsDB.doGetDBManager().doGetData(sqljob);
    this.JobName.Text = dsjob.Tables[0].Rows[0]["JobName"].ToString();
    this.JobPlace.Text = dsjob.Tables[0].Rows[0]["JobPlace"].ToString();   
    this.JobRemark.Text =dsjob.Tables[0].Rows[0]["JobRemark"].ToString().Replace("<","&lt").Replace(">","&gt").Replace(" ","&nbsp;").Replace("/n","<br/>");
    this.ManCount.Text = dsjob.Tables[0].Rows[0]["ManCount"].ToString();
    this.JobDate.Text = dsjob.Tables[0].Rows[0]["JobDate"].ToString();
    this.kicknum.Text= "("+"阅读次数"+dsjob.Tables[0].Rows[0]["TickCount"].ToString()+")";
    string sqldep="select * from BZ_Dic_Depart where DepartID="+dsjob.Tables[0].Rows[0]["DepartID"].ToString()+"";
    System.Data.DataSet dsdep = EYuanT.CommLib.clsDB.doGetDBManager().doGetData(sqldep);
    this.DepartName.Text = dsdep.Tables[0].Rows[0]["DepartName"].ToString();
   }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值