如何在ASP.net c#中获取客户端IP address.My应用程序。
当用户登录到我的应用程序时,jquery中有什么函数可以用来获取客户端的IP地址和名称吗?
谢谢
发布于 2017-02-17 17:32:49
我有这个小的C#属性片段,它返回连接到服务器的实际用户的IP地址。
public static string ClientIP
{
get
{
return HttpContext.Current.Request.UserHostAddress;
}
}如果要在JQuery源代码中使用,则需要将其插入到生成的cshtml中。
https://stackoverflow.com/questions/42294204
复制相似问题