如何检查浏览器是否在C#中启用了cookie [英] how to check if browser has cookies enabled in C#

查看:99
本文介绍了如何检查浏览器是否在C#中启用了cookie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在使用c#在asp.net web应用程序上工作。



i想知道,如何检查浏览器是否启用了cookie。



如果未启用,我如何启用它或提示用户执行此操作。





谢谢

Hi guys,

i'm working on asp.net web application using c#.

i want to know, how to check if browser has cookies enabled or not.

if its not enabled, how can i enabled it or prompt the user to do it.


Thanks

推荐答案

很遗憾你不能......只能去确定是尝试写一个cookie然后阅读它..



更多细节在这里..



< a href =http://msdn.microsoft.com/en-us/library/ms178194.aspx> http://msdn.microsoft.com/en-us/library/ms178194.aspx [< a href =http://msdn.microsoft.com/en-us/library/ms178194.aspxtarget =_ blanktitle =新窗口> ^ ]
unfortunately you cant..only way to determine is to try write a cookie n read it..

more details here..

http://msdn.microsoft.com/en-us/library/ms178194.aspx[^]


查看它们

check-if-browser-accepted-饼干 [ ^ ]

check-if-clients-browser-have-cookies-enabled [ ^ ]

A+better+cookies+enabled+detection+in+client+browser [ ^ ]
Check them out
check-if-browser-accepts-cookies[^]
check-whether-clients-browser-have-cookies-enabled[^]
A+better+cookies+enabled+detection+in+client+browser[^]


if (Request.QueryString["AcceptsCookies"] != null)
        {}


这篇关于如何检查浏览器是否在C#中启用了cookie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆