PC Review


Reply
Thread Tools Rate Thread

Get local IP on PPC without DNS

 
 
jeep
Guest
Posts: n/a
 
      3rd Oct 2005
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).

 
Reply With Quote
 
 
 
 
Eric
Guest
Posts: n/a
 
      4th Oct 2005

"jeep" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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) { }
}
}


 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      5th Oct 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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).
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding local user to local group or deleting local user fkitzmann Microsoft Windows 2000 4 16th Feb 2008 04:02 AM
Add domain user to local group via web application running under local admin account Chad Dressler Microsoft ASP .NET 0 30th Dec 2006 02:27 AM
WMI query local computer fails with access denied despite being local admin xr7 Windows XP WMI 0 17th Nov 2005 08:48 PM
Removing domain local groups from Wind XP local administrators group Olu Daniels Microsoft Windows 2000 Group Policy 7 22nd Oct 2005 07:08 AM
Local Users and Groups missing from Computer Mgmnt (Local) list todd Windows XP General 1 24th Aug 2003 11:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:57 PM.