ScriptSpot home

Forum topic · General Scripting

how to get mac address?

By flyingc · 2009-08-25

Description

hi.
because hardwarelockid is changed with diffrent version of max.
so i want to get physical address(mac) to protect my script.
how to get it with maxscript?
thanks

Comments (4)
Marco Brunetta

Hum I don't follow. The snippet I pasted outputs the different NICs and their addresses.

flyingc

it is so kind of you.
thanks

Marco Brunetta

allNICs = (dotNetClass


allNICs = (dotNetClass "System.Net.NetworkInformation.NetworkInterface").GetAllNetworkInterfaces()
FOR nic in allNICs DO 
(
	print ("NIC: "+nic.description+" - Address: "+ ((nic.getPhysicalAddress()).toString()))
)