How to retrieve visitor's IP in C# ASP.NET 2.0
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
return clientIPAddress;
Achievement provides the only real pleasure in life
string strHostName = System.Net.Dns.GetHostName();
string clientIPAddress = System.Net.Dns.GetHostAddresses(strHostName).GetValue(0).ToString();
return clientIPAddress;
Posted by SF at 7:10 pm
Labels: 2.0, ASP.NET, C#, retrieve IP
No comments:
Post a Comment