Solved

How to find out the MAC Address ?

Posted on 1998-06-02
3
403 Views
Last Modified: 2010-04-15
I'd like to know how to find out the MAC Address of a ethernet card in a programatically way.
Does anybody have a C algorithm to do that ?
The program will run in MS-DOS(!!!) environment.
0
Comment
Question by:edsont
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:lekshmikr
ID: 1251100
To get the Media Access Control (MAC) address for an ethernet adapter
programmatically, you can use NetBIOS if your card is bound to NetBIOS. Use
the Netbios() NCBASTAT command and provide a "*" as the name in the
NCB.ncb_CallName field. This is demonstrated in the sample code below.
 
With the NetBEUI and IPX transports, the same information can be obtained
at a command prompt by using:
 
   net config workstation

0
 

Author Comment

by:edsont
ID: 1251101
The problem is that my application won't have access to any protocols, so I can't use those APIs.

I think I've omitted that the ethernet card that my application will work with is NE2000 compatible.

What I really would like is a routine that could use hardware I/O to get the MAC address of the card.

Maybe I've posted this question in a wrong section . . .

0
 

Accepted Solution

by:
knappbl earned 20 total points
ID: 1251102
You can use the GUIDGEN utility (or the corresponding API call - CoCreateGuid.)  The last section of the GUID that is returned is actually the physical address of your ethernet card.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question