Get users mac address | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

25th Jul 2017, 12:50 AM
NewbCoder😎😎💪💪👅✌👈 - avatar
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: ] 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: ] 👉 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: ] 👉 Create a unique identifier yourself using some cryptographic algorithm and store it in a cookie. 👉 Extremely persistent cookies in a browser [ Like Evercookie API: ]
25th Jul 2017, 9:59 PM
Pao - avatar