多个字符串组成的Cookie怎样分别提取每一部分???
这是网上找到的例子<% @ language = "C#" %>
<script runat = "server" >
void WriteClicked ( Object Sender , EventArgs e )
{
//创建一个HttpCookie对象
HttpCookie cookie = new HttpCookie ( NameField . Text ) ;
//设定此cookies值
cookie . Value = ValueField . Text ;
//设定cookie的生命周期,在这里定义为一个小时
DateTime dtNow = DateTime . Now ;
TimeSpan tsMinute = new TimeSpan ( 0 , 1 , 0 , 0 ) ;
cookie . Expires = dtNow + tsMinute ;
cookie [ "姓名" ] = "王天" ;
cookie [ "性别" ] = "男" ;
cookie [ "年龄" ] = "26" ;
//加入此cookie
Response . Cookies . Add ( cookie ) ;
Response . Write ( NameField . Text + "Cookie创建完毕 <br > <hr > " ) ;
读取时怎样只提取name???或者年龄?? --------------------编程问答-------------------- Request.Cookies["姓名"] --------------------编程问答-------------------- Request.Cookies["姓名"].Value --------------------编程问答-------------------- HttpCookie cookie = Request.Cookies [ " Cookie的名称" ] ;
Cookie 是键值访问的
补充:.NET技术 , ASP.NET