Network adapter NetCfgInstanceId thru .NET

G

Guest

Hi,

Is there a way to get the netcfginstanceid of a network adapter thru C#? I
couldnt find any available classes that might do the trick. The
netcfginstanceid is available in the registry key
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\xxx".
One/more of the xxx's will have the network adapter in the system. The
"NetCfgInstanceId" in this xxx is what I am looking for. I cant directly go
to the registry and pick it up because I do not have any information about
the adapter I am interested in except its name. I cant use the name because
there can be multiple adapters in this registry key with the same name.

I know the INetCfg* component classes will enumerate all & give me the one I
am interested in but I dont want to use C++ and do interop if that is
possible.

Rgds,
Sushrut.
 
D

Dave Sexton

Hi Sushrut

Is the System.Net.NetworkInformation.NetworkInterface.Id property what you are looking for?

(.NET 2.0 Framework only)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top