473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Finding MAC Address

Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the
target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command (all
within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline.com

"To the Glory of God, The Father"

Nov 15 '05 #1
2 3271
Rick,

You can make a call to the GetIpNetTable function in the IP Helper API.
It will allow you to get the IP to MAC-address mapping table. You can also
call the SendARP function to make a request for the MAC address for a
particular IP address.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"FR3AK" <tr******@paiindustries.com> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the
target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command (all within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline.com

"To the Glory of God, The Father"

Nov 15 '05 #2
Thanks for your help.

I believe the SendARP only works on win2k machines and above, so i'll try
the GetIpNetTable function as you mentioned. :)

The code i have is working, but it's taking about 2 minutes to query an
entire subnet....i'm sure there's a better way to do this.

Thanks again for your response.
--
Rick King
rk***@royaline.com

"To the Glory of God, The Father"

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Oj**************@TK2MSFTNGP12.phx.gbl...
Rick,

You can make a call to the GetIpNetTable function in the IP Helper API. It will allow you to get the IP to MAC-address mapping table. You can also call the SendARP function to make a request for the MAC address for a
particular IP address.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"FR3AK" <tr******@paiindustries.com> wrote in message
news:Oc**************@tk2msftngp13.phx.gbl...
Hi.

does anyone have any idea of how to find the mac address of a remote
networking device? I've worked with WMI and it works fine as long as the target machine is a Windows computer, however, i want to return the MAC
address of ANY IP device on my network.

right now, i have a totally inefficient way to return a mac address, but
it's only by dropping to a command prompt and executing the ARP command

(all
within code....it's not as ugly as it sounds).

executing ARP within a loop (range of IP's to scan) is not a practical
solution. Has anyone had success in finding info on how to do this?

thank you for your assistance.
--
Rick King
cs****@royaline.com

"To the Glory of God, The Father"


Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Picture Dots | last post by:
Ok - I want to check a string for @ in it (Im checking to see if a string that should contain an email holds a @ ) How would I go about this? preg_match? ereg? strstr?Examples? Also - how...
2
by: Antitax | last post by:
I have a database with more than 800 adress records Some of the are similar because some letters in the street adress for example are not identical, altough they point to the same adress. Does...
9
by: Lauren Wilson | last post by:
Hi Folks, We've been using Crypto ++32 to control licensed access to our widely distributed Access 2K app. Unfortunately, Sampson Multimedia appears to be out of business. Does anyone out...
1
by: | last post by:
Hello, I'm keping myself busy here by investigating the world of LDAP and Active Directory. I have an application which allows users from the system to be selected from a list box and as a...
2
by: Lad | last post by:
Did anyone try to find out a regular expression for finding an email address in a text? Thank you for the reply L.
11
by: axlq | last post by:
Does anyone have a favored way of finding the geographic location of a user's IP address, so that a php script can include content relevant to that location? Reverse-lookup of the hostname isn't...
17
by: abhimanyu.v | last post by:
Hi Guys, I have one doubt. The test program is given below. It uses two way of finding out the offset of a variable in structure. I executed the program and found the same result. My question...
5
by: Timothy Grant | last post by:
On Tue, Aug 5, 2008 at 2:50 PM, David York <davideyork@gmail.comwrote: I'm not sure what you are trying to accomplish. The machine I'm typing this on has a 192.168.x.x number. The router that...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.