<%@ language="c#" %> 
<html>
<head>
		<title>request对象测试</title>
	</head>
	<body >
<%	bool flag;
	int loop1;
	HttpCookie MyCookie;
	HttpCookieCollection MyCookieCollection = Request.Cookies;
	flag=true;
	for (loop1 = 0;loop1<= MyCookieCollection.Count-1;loop1++ ) {
	      if( MyCookieCollection.GetKey(loop1) == "Visit_num1"){
		MyCookie = MyCookieCollection[loop1];
		MyCookie.Value =Convert.ToString(Convert.ToInt32(MyCookie.Value)+1);
		MyCookie.Expires = System.DateTime.Now.AddHours(1);
		Response.Cookies.Add(MyCookie);
		Response.Write( "您已是第" + MyCookie.Value + "次访问本站点了。");
		flag=false;
		break;
	      }
	}
	if (flag) { 
		MyCookie = new HttpCookie("Visit_num1");
		MyCookie.Value = "1";
		MyCookie.Expires = System.DateTime.Now.AddHours(1);
		Response.Cookies.Add(MyCookie);
		Response.Write( "欢迎您首次访问本站。");
	}
%>
	</body>
</html>
