Session.Contents,Context.Items,HttpContext.Current.Session之间的区别. [英] Difference between Session.Contents, Context.Items,HttpContext.Current.Session.

查看:104
本文介绍了Session.Contents,Context.Items,HttpContext.Current.Session之间的区别.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请分享一下
的概念
HttpContext.Current.Session

Session.Contents

Context.Items

举个例子...


我对存在差异感到困惑...

Please share me the concept of

HttpContext.Current.Session

Session.Contents

Context.Items

with example...


I am confuse about there difference...

推荐答案



Context.Items在HTTP请求期间设置或获取键/值集合,而ASP.NET会话状态使您可以跨多个请求存储与唯一的浏览器会话相关的信息.

Session.Contents属性允许您返回对当前会话状态对象的引用,该引用使您能够枚举包括名称和值在内的会话状态对象.根据MSDN文档,提供此Contents属性是为了与ASP的早期版本兼容.
Hi,

Context.Items set or get the key/value collection during an HTTP request while ASP.NET session state enable you to store information associated with a unique browser session across multiple requests.

The Session.Contents property allows you to returns a reference to the current session-state object which enable you to enumerate the session state object including name and value. According to MSDN document, this Contents property is provided for compatibility with earlier versions of ASP.


这篇关于Session.Contents,Context.Items,HttpContext.Current.Session之间的区别.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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