获取本地IP地址信息

public static string GetAddressIP()
{
///获取本地的IP地址
string AddressIP = string.Empty;
HttpContextAccessor context = new HttpContextAccessor();
AddressIP = context.HttpContext.Connection.RemoteIpAddress.ToString();
return AddressIP;
}

posted @ 2021-09-08 09:21  旧夏潜入梦  阅读(64)  评论(0编辑  收藏  举报