UserHostAddress in Asp.net Core

后端 未结 4 1030
挽巷
挽巷 2020-12-13 17:50

What is the equivalent in Asp.Net Core of the old HttpContext.Request.UserHostAddress?

I tried this.ActionContext.HttpContext but cannot fi

4条回答
  •  一个人的身影
    2020-12-13 18:24

    This has moved since the original answer was posted. Access it now via

    httpContext.Features.Get()?.RemoteIpAddress
    

提交回复
热议问题