How can I retrieved current user ip address in asp.net c# from my local LAN in my web page?
in my case I want for example : I have web page when I open it in any PC in my Local LAN I want to get this PC IP and PC user name to send them to SQl Database
This code get only the Sever IP:
public string GetLocalIP()
{
string _IP = null;
System.Net.IPHostEntry _IPHostEntry = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName());
foreach (System.Net.IPAddress _IPAddress in _IPHostEntry.AddressList)
{
if (_IPAddress.AddressFamily.ToString() == "InterNetwork")
{
_IP = _IPAddress.ToString();
}
}
return _IP;
}
thank U all