asp.net Core API 获取ip地址
2021-03-10 10:27
标签:add ipaddr res tpc microsoft override ext rri core 1.nuget 引用 Microsoft.AspNetCore.HttpOverrides 2.app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto }); 3.使用 var ip = HttpContext.Connection.RemoteIpAddress;//ip地址 asp.net Core API 获取ip地址 标签:add ipaddr res tpc microsoft override ext rri core 原文地址:https://www.cnblogs.com/zxp6/p/12692900.html
var port = HttpContext.Connection.RemotePort;//端口
文章标题:asp.net Core API 获取ip地址
文章链接:http://soscw.com/index.php/essay/62715.html