获取用户IP

public string UserHostAddress
{
get
{
if (HttpContext.Current != null &&
HttpContext.Current.Request != null &&
HttpContext.Current.Request.UserHostAddress != null)
return HttpContext.Current.Request.UserHostAddress;
else
return string.Empty;
}
}

posted @ 2016-10-28 23:52  拍空格  阅读(126)  评论(0编辑  收藏  举报