PDA

Click to See Complete Forum and Search --> : Enumerating Network Resources....


Sep 13th, 2000, 03:38 AM
Hi,

I'm looking for a way to enumerate a local PCs NIC, IP Address and Sub-Net Mask, for each given NIC installed in the machine.

For example, a laptop can have an IP Address assigned to a NIC in its docking-station as well as having one assigned to a PCMCIA card.

The problem is that the IP Addresses may not always be bound to the card at program run-time. Presumably, I need to be looking at various Registry entries (which ones?) or the NetAPI.

The end result is that data obtained will be inserted into a Word document (using Form-Fields).

Any suggestions greatfully received.

RM.

hitcgar
Sep 14th, 2000, 06:20 PM
I suggest you take a good look at WMI (SDK free from MS) which has tons of features. It has excellent and simple to code
networking functionalities.

You might try using the Win32_NetworkAdapterConfiguration class for retreiving the kinds of information you're
looking for. The above mentioned class can return all of what you need ( pretty sure anyway :eek: )

The IPSubnet property contains an array (string) of "all subnet masks associated with the current network adapter".

The IPAddress property contains like above but IP addresses.

DefaultIPGateway contains a "list of IP addresses of default gateways used by the computer system."

etc.

I'm sure WMI has the functionalities you need. ;)

[Edited by hitcgar on 09-14-2000 at 07:35 PM]