Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6318909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T15:42:41+00:00 2026-05-24T15:42:41+00:00

I am using NetworkInterface.GetAllNetworkInterfaces() to take my network interfaces, then I trying to take

  • 0

I am using NetworkInterface.GetAllNetworkInterfaces() to take my network interfaces,

then I trying to take my MAC addreses (NetInterf[i].GetPhysicalAddress())

and it takes me my real interfaces and some trash:

[0]: ""
[1]: "00E018998877"
[2]: "001F3C0B4F5D"      
[3]: ""
[4]: "00000000000000E0"
[5]: "00000000000000E0"
[6]: "00000000000000E0"
[7]: "00000000000000E0"

[1] and [2] my real MAC adress but other is wrong,
MAC addres must have 6 bytes, isn’t?

In program I am filtering with such condition

if (NetInterf[i].GetPhysicalAddress().GetAddressBytes().Length == 6)

I’m doing right? Because I can’t find anything about it in MSDN.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T15:42:41+00:00Added an answer on May 24, 2026 at 3:42 pm

    The more clear way to get all real interfaces will be to use WMI. You can retrieve all network adapters information from the Win32_NetworkAdapter class. To determine whether the adapter is a physical or a logical adapter need to check PhysicalAdapter property. Here is example:

    var scope = new ManagementScope(@"\\localhost\root\cimv2");
    scope.Connect();
    var query = new ObjectQuery(@"SELECT * FROM Win32_NetworkAdapter WHERE PhysicalAdapter = True");
    var searcher = new ManagementObjectSearcher(scope, query);
    
    var networkInterfaces = searcher.Get();
    foreach (var networkInterface in networkInterfaces)
    {
        Console.WriteLine(string.Format("{0} - {1}", networkInterface["MACAddress"], networkInterface["Name"]));
    }
    

    Using NetworkInterface.GetAllNetworkInterfaces() you can’t determine that for sure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using NetworkInterface.GetAllNetworkInterfaces() to get all the interfaces on a PC. However, this
I am using NetworkInformation namespace to list all the network devices. NetworkInterface.GetAllNetworkInterfaces(); When I
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
We're monitoring usage statistics of a network interface using NetworkInterface.GetIPv4Statistics() in .NET 2.0. This
Using online interfaces to a version control system is a nice way to have
I am using this code to find the MAC address of a machine. This
Using PHP, I'm trying to give each specific text its own variable. I believe
I am attempting to pull some information from my tnsnames file using regex. I
I'm trying to build a C++ extension for python using swig. I've followed the
Using the Sanitize gem, I'm cleaning some HTML. In the href attribute of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.