MAC address of a machine

Any one knows how to get MAC address of a machine who is accessing
your application.Help me.

a method like the one below will find the ethernet mac address of my
Mac on OS-X 10.4

def mac_address
system “ifconfig | grep lladdr > mac.txt”
f =“mac.txt”)
mac = “”
f.each{|l| mac = l.split(" ").last}
return mac

It’s really quite hacky, but you’re going to need to make a system
call to do that. At least I cannot think of any classes available for
it. On windows maybe the Win32ole or Win32API classes but nothing on
and BSD platforms.


On Feb 21, 10:11 pm, Shiva K. [email protected]

On 21 Feb 2008, at 11:37, cammo wrote:


output = ifconfig | grep lladd at least avoids the temporary file
unpleasantness (or use IO.popen)


nearly impossible

On 21 ÆÅ×, 13:11, Shiva K. [email protected]