Solved

Getting MAC Address of more than one NIC

Posted on 2003-11-13
15
842 Views
Last Modified: 2010-04-05
I want to make my application to get the MAC Address of all of the NIC Adapters on the computer. If the computer has two or three or more NIC Adapter, get the MAC Address of each one. This question is for an expert. Who ever get´s it right, I´ll increase the points.
0
Comment
Question by:si0347429
[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
15 Comments
 
LVL 5

Expert Comment

by:arjanh
ID: 9742219
0
 
LVL 8

Expert Comment

by:gmayo
ID: 9742525
Unfortunately not reliable on 95 or 98 (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/netbios/netbios_1l82.asp). Also relies on netbios being installed, which is not always the case.

Have a look at http://community.borland.com/article/0,1410,26040,00.html - ignore the first one as it is the same as above. Look at the 3rd one, SNMP, which appears to be the only reliable method. Only problem: C++.

Geoff M.
0
 
LVL 23

Expert Comment

by:Ferruccio Accalai
ID: 9742689
In addition to Geoff post (that is the right way) at this point: 'Only problem: C++.'
Fortunatelly Project Jedi gives lot of solutions for Delphi developers too...so you can get the API SNMP.h translation for Delphi here ftp://delphi-jedi.org/api/snmp.zip (also example included) and look at the above Article for Delphi (french language but most useful than the C++ one) at http://www.iglooduhack.com/delphi_adresse_mac.php

F68 ;-)
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 3

Expert Comment

by:JDuncan
ID: 9749481
This is a great routine for doing everything you want networks/adapters/and mac addresses.

do a search on yahoo for tcpmon12.zip . it was written by
Dirk Claessens  <dirkCL@pandora.be>  and uses tcp/ip to enumerate all network resources and information including mac addresses.

If you want to use netbios to do the same using netbios then search for getmacad.zip on yahoo
    written by Vlad Sharnin  vladshar@ufanet.ru  

I don't have the original sites for the above but I can email the files if you have trouble finding them.

0
 

Author Comment

by:si0347429
ID: 9780057
Hey JDuncan I searched for tcpmon12.zip and i didn´t find it. Can you send it to me please. My e-mail is "si0347429@univale.br"
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9786932
my yahoo account keeps rejecting you email address - is it correct?
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9786999
Yopu can upload the file from :-

http://81.137.231.48/upload/tcpmon.zip
0
 

Author Comment

by:si0347429
ID: 9796282
Hey JDuncan do you know if it´s really possible to know which MAC is from what IP Address ? Because it shows it. But i´m no sure if it´s really possible. What do you think ???
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9797354
Not sure I understand your question.

The same ethernet address(machine) can be bound to multiple network adapters
0
 

Author Comment

by:si0347429
ID: 9797727
First I would like to thank you for the tcpmon file. What i´m trying to ask is. Each NIC has it´s own MAC address and IP. Can I trust  on the infomation tha it´s telling me which is for example: the NIC´s IP Address is 100.100.1.10 and it´s MAC Address is 00-01-29-52-04-A4.
0
 
LVL 3

Accepted Solution

by:
JDuncan earned 300 total points
ID: 9797805
Yes you can . The mac address comes from the network card's flash rom and is setup by the
manufacturer. You can also tell the manufacturer and model of the card from the mac address.
The ip address comes from windows  and is bound to the network card.

On normal pc's the only way for the card to be wrong is if someone re programs its flash .

I believe some PDA's have a mac address which can be setup by software.

The information is coming off the machines network card. Also if you try to get the mac address of a remote machine over a network via TCOP/IP this uses the wake on lan facility inside the network card. I don't think its possible using older cards . You then have to resort to netbios calls for these.
0
 

Author Comment

by:si0347429
ID: 9811571
JDuncan,
  Thank you. It was exactly what I needed man. I jus changed some things to do what I need. You helped me alot. Do you know if there´s anything like this one, but instead of getting the MAC, get the Video Card. I increased more 50 points for you.
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9814503
Thanks, can you set the answer as accepted.

I think you can enumerater all system resources , i'll have a look

Jim Duncan
0
 

Author Comment

by:si0347429
ID: 9816773
Thanx.
0
 
LVL 3

Expert Comment

by:JDuncan
ID: 9845315
I found this , its not much it only gives you the monitor sizes.

Thes is a function EnumDisplayMonitors somewhere which may give more info.
The function EnumMonitors is more fore system monitors like print servioces etc.


 uses multimon;

  myMonitor : TMonitor;
  monInfo : PMonitorInfo;
begin
    new(monInfo);
    i:=Screen.MonitorCount;
    for i:=0 to Screen.MonitorCount-1 do begin
      myMonitor:=Screen.Monitors[i];
      GetMonitorInfo(myMonitor.Handle,monInfo);
      Showmessage(inttostr(monInfo.cbSize));
      Showmessage(inttostr(monInfo.rcWork.Right));
    end;
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 13 hours left to enroll

635 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