可与http://www.cnblogs.com/oupatch/archive/2005/03/16/119554.html结合使用.
//适应于整站,而不仅是一个贴子.
private void Submit_Click(Object sender,EventArgs e)
{
  //读取Cookie的值(应先检查此Cookie是否存在).
  if(Request.Cookies["UID"]!=null){
    DateTime temp=Convert.ToDateTime(Request.Cookies["UID"].Value);
    if(DateTime.Now<temp.AddMinutes(1)){
      Response.Write("<script>alert('不能连续提交,两次发言间隔为1分钟!!');"+"</"+"script>");
      return;
    }
  }

  HttpCookie cookie=new HttpCookie("UID",DateTime.Now.ToString());
  cookie.Expires=DateTime.Now.AddDays(1);
  Response.Cookies.Add(cookie);

  Response.Write("<script>alert('执行按钮处理!!');"+"</"+"script>");
}

大家如有更好的解决方案,欢迎交流讨论.

相关文章:

  • 2021-09-07
  • 2021-09-30
  • 2021-07-02
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2021-05-27
  • 2021-11-03
猜你喜欢
  • 2022-02-10
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
相关资源
相似解决方案