[Closed] MAC address?
I have been looking at code on the web in c# and just have not been able to reproduce it in Max script. Any one know how to get the MAC address of the system?
Are you looking to do it in pure MXS or are you open to dotNet?
Always happens, I poke at something for ages and as soon as I post I get it.
ni=dotNetClass "System.Net.NetworkInformation.NetworkInterface"
penDotNet.show ni
ni.GetIsNetworkAvailable()
all=ni.GetAllNetworkInterfaces()
MACAddress=all[1].GetPhysicalAddress()
for a in all do print ((a.GetPhysicalAddress()).toString())
Unless I’m missing something Kevin what I have is a whole lot simpler. The code you posted is converting int values to hex to string instead of just using toString()
Yeah your method is much more concise, I think the one I posted was made in an older version of max. The other suggestion was to compile a dll in C, but I still prefer the method you came up with here. Good to see you found what you needed.
Well I don’t think that the older version would make any difference as the toString method would have still been there.