+ 2
Get users mac address
I have a c# program which I want to sell on my website...I want to make it so that when someone clicks the buy button, their Mac address is sent to me, then I edit the program so that if the PC it is running on does not have that Mac address, if will close
1 Answer
+ 8
As far as I'm concerned there's no standard JavaScript API for getting a MAC address. [ See the full list of APIs: https://www.w3.org/standards/techs/js#w3c_all ] Actually, access to this information is restricted because the MAC address uniquely identifies the device so it would be a security vulnerability if you were able to do this directly from JavaScript.
Alternative ways to get the MAC address:
đ Use a Java applet and call it with JavaScript, but it would need to be signed and have a policy file [ Reference: https://stackoverflow.com/questions/4467905/getting-mac-address-on-a-web-page-using-a-java-applet ]
đ External components like ActiveX for IE, XPCOM for FireFox installed as an extension.
Alternative ideas to get a unique identifier:
đ Get the private IP address using JavaScript [ Reference: http://ourcodeworld.com/articles/read/257/how-to-get-the-client-ip-address-with-javascript-only ]
đ Create a unique identifier yourself using some cryptographic algorithm and store it in a cookie.
đ Extremely persistent cookies in a browser [ Like Evercookie API: http://samy.pl/evercookie/ ]