472,125 Members | 1,533 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,125 software developers and data experts.

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 4540
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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.