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

Reading number is top 10 articles
一种通过sql,server的作业调度+存储过程来建立自动备份的方法_[SQL,Server教程]
MVC,3.0,在各个版本IIS中的部署_.net资料_编程技术
Microsoft,OLE,DB,Provider,for,SQL,Server,错误,'80040e37',对象名,’无效。_mssql学习_编程技术
SQL,Server数据库查询语句精华使用简介_[SQL,Server教程]
JavaScript变换图片的几种方法_JavaScript技术_编程技术
asp.net2.0服务器控件SiteMapPath的功能
预载入和javascript,Image()对象_JavaScript技术_编程技术
ASP.NET技巧:正则表达式提取数字_[Asp.Net教程]
CView类的GetDocument()成员函数
如何在十天学内会php之第三天_[PHP教程]
Reading number is top 10 pictures
The other a successor of sora aoi
初五接财神啦!五路财神齐来到
Magnificent cloud1
The money of more than 100 countries and regions18
A man's favorite things16
Li Zongrui hunting video screenshots2
So beauty, will let you spray blood7
The money of more than 100 countries and regions13
中国文革时期的色情图片2
A man's favorite things8
Download software ranking
Sora aoi, the nurse, uniform ,nursing assistant
Tram sex maniac 2 (H) rar bag5
Unix video tutorial7
Boxer vs Yellow4
Such love down(擒爱记)
Professional killers2 for Android
Boxer's Top ten classic battle6
天龙八部十二宫服务端
C++教程第四版
apache-tomcat-6.0.33
aaa published in(发表于) 2013/12/15 8:54:50 Edit(编辑)
轻松检测浏览器是否接受Cookies信息_.net资料_编程技术

轻松检测浏览器是否接受Cookies信息_.net资料_编程技术

轻松检测浏览器是否接受Cookies信息_.net资料_编程技术-你的首页-uuhomepage.com

  一种确定浏览器是否接受 Cookie 的方法是先编写一个 Cookie,然后再尝试读取这个 Cookie。如果不能读取这个 Cookie,则可以认为该浏览器不接受 Cookie。


  我编写了一个简单的示例来说明如何测试 Cookie 是否被接受。该示例包含两个页面。在第一个页面中,我编写了一个 Cookie,然后把浏览器重新定向到第二个页面。第二个页面尝试读取这个 Cookie,转而将浏览器重新定向到第一个页面,并向 URL 添加一个带有测试结果的查询字符串变量。


  第一个页面的代码如下:



protected System.Web.UI.WebControls.Label labelAcceptsCookies;
private void Page_Load(object sender, System.EventArgs e)
...{

if(!IsPostBack)
...{
WriteCookie();

}
}
private void WriteCookie()
...{
if( Request.QueryString["AcceptsCookies"] ==null)
...{
Response.Cookies["TestCookie"].Value = "ok";
Response.Cookies["TestCookie"].Expires = DateTime.Now.AddMinutes(1);
Response.Redirect("CookieRead.aspx?redirect="+Server.UrlEncode(Request.Url.ToString()));
}
else
...{
labelAcceptsCookies.Text = "接受 Cookie = "+Request.QueryString["AcceptsCookies"];
}
}





添加到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.