Home
Manage Your Code
Snippet: IP Address (C#)
Title: IP Address Language: C#
Description: This C# code snippet allows the user to retrieve the IP address of the Host PC Views: 538
Author: Ivica Star Date Added: 10/20/2008
Copy Code  
1using System.Net;
2
3String strHostName  = Dns.GetHostName();
4IPHostEntry ipEntry = Dns.GetHostEntry(strHostName);
5IPAddress[] addr    = ipEntry.AddressList;