C# 获取客户端主机IP

string IP = HttpContext.Request.UserHostAddress;

原文地址:https://www.cnblogs.com/-7999/p/13735761.html