Home
Manage Your Code
Snippet: Find the IP of a WinCE device (C#)
Title: Find the IP of a WinCE device Language: C#
Description: Works also on devices without shells, such as emulators... Views: 147
Author: Diego Guidi Date Added: 3/8/2007
Copy Code  
1/// <summary>
2/// Descrizione di riepilogo per Program.
3/// </summary>
4public class Program
5{
6	/// <summary>
7	/// Il punto di ingresso principale dell'applicazione.
8	/// </summary>
9	static void Main(string[] args)
10	{
11		try
12		{
13			IPHostEntry he = Dns.Resolve(Dns.GetHostName());
14			foreach (IPAddress addr in he.AddressList)
15				MessageBox.Show(addr.ToString());				
16		}
17		catch(Exception ex)
18		{
19			MessageBox.Show(String.Format("Caught: {0}\r\n{1}", ex.GetType().ToString(), ex.Message));
20		}			
21	}
22}