All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#中ErrorProvider组件应用实例
HTML组件HTML COMPONENTS之三_[Html教程]
同步两个Sql,server(3)_[SQL,Server教程]
PHP开发入门教程之面向对象_php资料_编程技术
经验之谈:MySQL与ASP.NET配合更强大_.net资料_编程技术
SQL命令大全--中文翻译_[SQL Server教程]
Asp.net关于Header/title/Meta,tages/Style操作的小技巧_[Asp.Net教程]
如何最大限度提高.NET的性能,(续)_.net资料_编程技术
怎样在Web开发中完美控制IE标题栏_[Asp.Net教程]
SQL循序渐进(19)DISTINCT和排除复制_[SQL,Server教程]
Reading number is top 10 pictures
The world's ten biggest attractions of inventory super the moon
Lewd,it is too lewd.
So beauty, will let you spray blood4
Fender Bender that so horrifying1
The household of rural style is designed
八个盛产美女的国家1
A cat have life principles
狗狗与主人神同步1
PengLiYuan lady for the world health organization fight TB and AIDS goodwill ambassador
Sora aoi calligraphy show
Download software ranking
Be there or be square
The hero
C语言教程TXT
Take off clothes to survival
White deer villiage
WebService在.NET中的实战应用教学视频 → 第3集
少妇苏霞全本
Popkart Cracked versions Mobile phone games
Proficient in JavaScript
艳兽都市
归海一刀 published in(发表于) 2014/1/30 1:18:14 Edit(编辑)
ASP.NET中Cookie的使用介绍_[Asp.Net教程]

ASP.NET中Cookie的使用介绍_[Asp.Net教程]

ASP.NET中Cookie的使用介绍_[Asp.Net教程]
Cookie为客户端信息存放对象,可以把用户的信息保存在用户本地,不必总是访问服务器

与Session不同,Session为用户全局变量,对于该用户的所有操作过程都有效。

//创建Cookie对象

HttpCookie newCookie = new HttpCookie("User");

//Cookie中添加信息项:为键值对,key/value

newCookie.Values.Add("Name",tbUserName.Text.Trim());
newCookie.Values.Add("Psd",tbUserPsd.Text.Trim());

//如果不设置Expires属性,即为临时Cookie,浏览器关闭即消失

newCookie.Expires = DateTime.Now.AddDays(1); //设置过期天数为1天

//通过Request对象读取得到Cookies的值

HttpCookie newCookie = Request.Cookies["User"];

//通过Response对象写入客户端的Cookie

newCookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(newCookie);


添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.