测试没有问题
js文件
function getCookie(name)
{
var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");
if(arr=document.cookie.match(reg))
return unescape(arr[2]);
else
return null;
}
function delCookie(name)
{
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval=getCookie(name);
if(cval!=null)
document.cookie= name + "="+cval+";expires="+exp.toGMTString();
}
httprequest
Dim cnt As Integer = 1
Integer.TryParse(e.Cookies("count"),cnt) '提取cookie的值, 并转换为整数
cnt = cnt + 1
e.AppendCookie("count",cnt) '在客户端存储Cookie
Dim sb As New StringBuilder
sb.appendLine("<!doctype html>")
sb.appendLine("<html>")
sb.appendLine("<head>")
sb.appendLine("<meta charset='utf-8'>")
sb.appendLine("<title>表单</title>")
sb.appendLine("</head>")
sb.appendLine("<body>")
sb.AppendLine("<input Type='button' name='Sumbit' id='Sumbit' value='确定' onclick='delCookie(""count"")'>")
sb.appendline("<script src='./lib/ajx.js'></script>") '引入脚本文件
sb.appendLine("</body>")
sb.appendLine("</html>")
e.WriteString(sb.ToString)
[此贴子已经被作者于2020/12/24 9:55:58编辑过]