我下面写的测试时有效果,但是传到服务器上就没用了或者哪位大大有更好的方法 请教!!!!flink.aspx里的: HttpCookie cookie = Request.Cookies["time"];
if (cookie != null)
{
if (DateTime.Compare(Convert.ToDateTime(cookie.Value), DateTime.Now) < 30)
{
Response.Write("禁止在30秒内连续提交");
}
}
else
{
Response.Cookies["time"].Value = DateTime.Now.ToString();
Response.Cookies["time"].Expires = DateTime.Now.AddSeconds(30);
Response.Write("<script>alert('申请成功'),window.location.replace('test.htm');</script>");
}
test.htm里就是一张指向flink.aspx的表单
if (cookie != null)
{
if (DateTime.Compare(Convert.ToDateTime(cookie.Value), DateTime.Now) < 30)
{
Response.Write("禁止在30秒内连续提交");
}
}
else
{
Response.Cookies["time"].Value = DateTime.Now.ToString();
Response.Cookies["time"].Expires = DateTime.Now.AddSeconds(30);
Response.Write("<script>alert('申请成功'),window.location.replace('test.htm');</script>");
}
test.htm里就是一张指向flink.aspx的表单
解决方案 »
- 在ASPX里 怎么写循环?
- Request参数获取错误
- 搞死人啦 grid 绑定数据库事件触发的问题还是没有到解决哪个大侠来帮帮我啦
- |M| DataView 进行复制 DataView 的办法
- 做安装包时,怎么才能把一些第三方的.DLL安装到操作系统system32目录下并自动注册?
- 请救,上传图片问题,有图片路径时,点提交没反应,没有时,可以提交
- 问一下,ASP.NET环境下有没有与ASP中的recordset对应的namespace ?
- 读取文件问题。。。在线等待,急
- 如何将string类型的"123"转换成int类型的123
- 文本框输入验证问题
- .net from验证过期问题
- Access怎么建立主外键啊?能像SQL一样吗?怎么建立?
btnOK.Attributes.Add("onclick", this.GetPostBackEventReference(btnOK) + ";this.disabled=true;");
Thread.Sleep(1000);
btnOK.Style.Remove("disabled");
=========
if ((DateTime.Now-Convert.ToDateTime(cookie.Value)).TotalSeconds < 30)
<script>alert('申请成功'),window.location.replace('test.htm');
============
<script>alert('申请成功');window.location.href='test.htm';