Answer:
string client_IP_address = Dns.GetHostAddresses(System.Net.Dns.GetHostName()).GetValue(1).ToString();
We have to import System.Net Namespace.
GetHostAddresses returns IP address for the specified Host.
DNS stands for Domain Name Server, which provide Domain Name.
Asked In: Many Interviews |
Alert Moderator