语境
我在控制器中。
我使用命名空间System.Web
:
using System.Web;
当我打电话时HttpContext.Current
,VS 会提醒我Current
未定义的内容HttpContextBase
:
HttpContext.Current.Session["currentUser"];
如果我System.Web
之前指出HttpContext.Current
,它的工作原理:
System.Web.HttpContext.Current.Session["currentUser"];
问题
为什么要System.Web
在前面注明HttpContext.Current
?