Context.User.Identity.Name VS HttpContext.Current.User.Identity.Name [英] Context.User.Identity.Name vs HttpContext.Current.User.Identity.Name

查看:199
本文介绍了Context.User.Identity.Name VS HttpContext.Current.User.Identity.Name的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在aspx.net,是

In aspx.net, what is the difference between

Context.User.Identity.Name 

HttpContext.Current.User.Identity.Name

即时通讯目前使用 Context.User.Identity.Name 从母版,并有与用户identitys beeing混合起来(用户A看到用户B的数据)的麻烦。难道这是问题的根源?

Im currently using the Context.User.Identity.Name from a masterpage and are having trouble with user identitys beeing mixed up (user A sees user B data). Could this be the source of the problem?

推荐答案

他们是相同的。 上下文具有当前的参考的HttpContext 这是一样的 HttpContext.Current 。所以,我不认为这是造成你所遇到的问题。

They are identical. Context has a reference to the current HttpContext which is the same as HttpContext.Current. So, I don't think this is causing the problem that you are having.

这篇关于Context.User.Identity.Name VS HttpContext.Current.User.Identity.Name的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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