ASP中的COOKIE
类别: ASP教程
例子用于接收cookies.
<!-- Cookie display table -->
<TABLE BORDER="2">
<THEAD>
<TH>Cookie Name</TH>
<TH>Cookie Value</TH>
<TH>Delete Cookie</TH>
</THEAD>
<%
Dim Item
\' Loop through the cookie collection displaying each cookie we find
For Each Item in Request.Cookies
%>
<TR>
<TD><% = Item %></TD>
<TD><% = Request.Cookies(Item) %></TD>
<TD><A HREF="cookie_process.asp?name=<%= Server.URLEncode(Item) %>">Delete this cookie!</A></TD>
</TR>
<%
Next
%>
</TABLE>
<!-- Cookie adding form -->
<FORM ACTION="cookie_process.asp" METHOD="get">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD>Cookie Name:</TD>
<TD>Cookie Value:</TD>
<TD></TD>
</TR>
<TR>
<TD><INPUT TYPE="text" NAME="name"></INPUT></TD>
<TD><INPUT TYPE="text" NAME="value"></INPUT></TD>
<TD><INPUT TYPE="submit" VALUE="Add Cookie!"></TD>
</TR>
</TABLE>
</FORM>
<!-- Cookie display table -->
<TABLE BORDER="2">
<THEAD>
<TH>Cookie Name</TH>
<TH>Cookie Value</TH>
<TH>Delete Cookie</TH>
</THEAD>
<%
Dim Item
\' Loop through the cookie collection displaying each cookie we find
For Each Item in Request.Cookies
%>
<TR>
<TD><% = Item %></TD>
<TD><% = Request.Cookies(Item) %></TD>
<TD><A HREF="cookie_process.asp?name=<%= Server.URLEncode(Item) %>">Delete this cookie!</A></TD>
</TR>
<%
Next
%>
</TABLE>
<!-- Cookie adding form -->
<FORM ACTION="cookie_process.asp" METHOD="get">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD>Cookie Name:</TD>
<TD>Cookie Value:</TD>
<TD></TD>
</TR>
<TR>
<TD><INPUT TYPE="text" NAME="name"></INPUT></TD>
<TD><INPUT TYPE="text" NAME="value"></INPUT></TD>
<TD><INPUT TYPE="submit" VALUE="Add Cookie!"></TD>
</TR>
</TABLE>
</FORM>
- 上一篇: 另类扩展名同样执行ASP
- 下一篇: 判断判断COOKIES是否处于开启状态是否处于开启状态
-= 资 源 教 程 =-
文 章 搜 索