469,337 Members | 6,005 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,337 developers. It's quick & easy.

Network adapter NetCfgInstanceId thru .NET

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\Contr ol\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.
Jul 21 '06 #1
1 4286
Hi Sushrut

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

(.NET 2.0 Framework only)

--
Dave Sexton

"Sushrut" <Su*****@discussions.microsoft.comwrote in message news:09**********************************@microsof t.com...
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\Contr ol\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.

Jul 22 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Matthew K Jensen | last post: by
3 posts views Thread by hitchiker | last post: by
1 post views Thread by Misha | last post: by
8 posts views Thread by rongchaua | last post: by
4 posts views Thread by =?Utf-8?B?TWFydGlu?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by Marylou17 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.