如何获取用户机器。 asp.net中的IP? [英] How to get User machine. IP in asp.net?
本文介绍了如何获取用户机器。 asp.net中的IP?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在asp.net中获取用户机器IP ??
我正在尝试此代码,其中logMachine名称正确,但IP不正确。
How to get User machine IP in asp.net??
I am trying this code, in which logMachine name is got correctly, but IP is incorrect.
String logMachine = System.Net.Dns.GetHostEntry(Request.UserHostAddress).HostName;
String IP Address = Request. UserHostAddress;
推荐答案
查看这些链接。 />
如何获取客户端IP地址 [ ^ ]
如何在ASP.NET中获取用户的客户端IP地址? [ ^ ]
如何在asp.net(C#)中获取客户端IP。 [ ^ ]
在ASP.NET中查找客户端IP地址和位置 [ ^ ]
希望这有帮助。
Hi,
check these links.
how to get client IP address[^]
How to get a user''s client IP address in ASP.NET?[^]
How to get client IP in asp.net(C#).[^]
Find Client IP Address And Location in ASP.NET[^]
hope this helps.
使用这个
use this
string IP= Request.ServerVariables["HTTP_X_FORWARDED_FOR"];
这篇关于如何获取用户机器。 asp.net中的IP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文