开发者

Same code or not for UserHostAddress?

Are the two methods below identical?

HttpContext.Cur开发者_如何学Gorent.Request.UserHostAddress

and

HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]


Seems so. According to ILSpy the

HttpContext.Current.Request.UserHostAddress

maps to

// System.Web.Hosting.ISAPIWorkerRequest
public override string GetRemoteAddress()
{
    return this.GetServerVariable("REMOTE_ADDR");
}

So in my opinion, it is the same.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜