PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Get local IP on PPC without DNS
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Get local IP on PPC without DNS
![]() |
Get local IP on PPC without DNS |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
I am trying to provide a list of local IPs on my PPC (WM 2003) for use
in a UDP application. dns seems to be the most common moethod, but it is not available in the environment. It is likely that there will be a wifi and bluetooth connection available so I need the user to select the appropriate IP (likely wifi). |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"jeep" <kenm16@gmail.com> wrote in message news:1128374593.347132.102440@g44g2000cwa.googlegroups.com... > I am trying to provide a list of local IPs on my PPC (WM 2003) for use > in a UDP application. dns seems to be the most common moethod, but it > is not available in the environment. It is likely that there will be a > wifi and bluetooth connection available so I need the user to select > the appropriate IP (likely wifi). > wish this could help ![]() using System; using System.Net; // *usage* Demo '--hostname' public class Demo { public static void Main(string[] argv) { try{ if(argv.Length == 0) return; IPHostEntry hostInfo = Dns.GetHostByName(argv[0]); if(hostInfo.AddressList.Length >= 1) { Console.WriteLine("{0}", hostInfo.AddressList.Length); foreach(IPAddress ipa in hostInfo.AddressList) { Console.WriteLine("{0}",ipa.ToString()); } } } catch(Exception e) { } } } |
|
|
|
#3 |
|
Guest
Posts: n/a
|
That's not a problem. On the PC, the way this specific type of thing is
actually done is *not* with DNS, which is a defined protocol for querying well-known servers for translations between things like www.microsoft.com and the IP address where that server can be found. To provide a local list of mappings on the desktop, you'd use a 'hosts' file. On Windows CE, you can store something like that in the registry: HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\host name The settings are documented in MSDN on a page titled "TCP/IPv4 Configurable Registry Settings". Paul T. "jeep" <kenm16@gmail.com> wrote in message news:1128374593.347132.102440@g44g2000cwa.googlegroups.com... >I am trying to provide a list of local IPs on my PPC (WM 2003) for use > in a UDP application. dns seems to be the most common moethod, but it > is not available in the environment. It is likely that there will be a > wifi and bluetooth connection available so I need the user to select > the appropriate IP (likely wifi). > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 


