1

The (short) question: Is it possible to get the host's mac address in an mvc application? How?

Details:
I have an MVC application that will be distributed and installed/hosted in different windows machine to run locally. Now I want to implement a licensing feature where I get the host machine's mac address, generate a serial for that specific machine and insert those details, the mac address and the serial for that - in their database.

The plan is then to create a global filter for the controllers to verify that the mac address and serial saved in the database is valid before they can access that controller. I CAN DO ALL THESE.

But the main issue is, the mac address is saved in the database, so someone can just copy that mac address and serial combination to another host machine and it would still work. The solution is to make my MVC application read the host machine's mac address and confirm if it matches the mac saved in the database, replace if not and continue with the validation of serial. How can I get my MVC application to read the mac address of the HOST computer (not the client that is browsing the web app.) Is this even possible?


Some might say: Just host your app in your own hosting service!

My answer is that yes that is the ideal option but in my country, not everyone can afford reliable internet connection for their businesses. So I need to provide a solution that will work fine in these circumstances(in my case, let them host the app in their own computer) but also provide security to the application I'm developing.

1 Answers1

0

You can use Page.Request.UserHostAddress but getting MAC address is bit difficult but you can, you need to use a WMI. "You need to create an object in JavaScript, query the WMI and pass the information back to the server. In addition you need to allow access to unsigned ActiveX in IE. "