【发布时间】:2015-06-13 14:37:49
【问题描述】:
我在 VS 2013 中运行 .NET 4.5 项目。为什么下面的代码会出错?
var w = Request.Properties["MS_HttpContext"] as System.Web.HttpContextWrapper;
string IP = w?.Request.UserHostAddress; //fail to compile
我在MSDN blog 上找到了这段代码。
【问题讨论】:
标签: c# c#-6.0 null-propagation-operator