[英]Error when using the null-propagating / null-conditional operator
我在VS 2013中运行.NET 4.5项目。为什么以下代码出错?
var w = Request.Properties["MS_HttpContext"] as System.Web.HttpContextWrapper;
string IP = w?.Request.UserHostAddress; //fail to compile
我在这个MSDN博客上找到了这段代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.