答案:用cookie。设置一个cookie,有效期为7天,然后读去cookie,第一次因为没有cookie所以弹出,并且设置该cookie,之后7天内都有该cookie所以不弹出,当7天之后cookie过期,又重新弹出并重新设置cookie。
<%
if isNull(Request.Cookies("username")) or Server.HtmlEncode(Request.Cookies("ad").Value)<>"start" then
Response.Cookies("ad").Value="start";
Response.Cookies("ad").Expires=DateTime.Now.AddDays(7);
else
Call 弹广告
end if
%>
[page_break]
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>index</title>
</head>
<%
mydate="10/23/2006"
mydate=dateadd("d",10,mydate)
if DATEDIFF("d",DATE,mydate) > 0 Then
%>
<script language="javascript">
window.open('http://cn58.net‘)
</script>
<%
Else
response.write "no"
end If
%>
<body>
</body>
</html>