File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes help with Locking Java Code to MAC adress Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "help with Locking Java Code to MAC adress " Watch "help with Locking Java Code to MAC adress " New topic

help with Locking Java Code to MAC adress

Todor Vachev

Joined: Apr 27, 2011
Posts: 2
Hello guys, I used the code to get MAC from another thread in this forum but there's one thing left for me to do, to do what I want to do, much to do's lets get to work

I'm making this program for my cousin but I don't want him to send it to someone else, so I want to make it to work only and only on his PC. This is the whole program.
So basically what I want to do is to make the code inside if ( mac == mac1 ) to work only if mac equals to mac1, how to write his mac inside the program (I want to be the one that's Defining the mac not the program itself I want to write the mac adress inside it, mac1 = 00 00 00 00 00 00) so that the program can compare them and run the code for my small math program and if they are not equal the user gets an Error. Thanks everyone in advance I hope you understood what I want to do
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10767

Off my head I can think of two approaches
1) Storing mac1 in a Properties file. This file can be bundled in your application jar.
2) Using Java Web Start and defining mac1 in the JNLP file. (This approach would mean a net connection to your server whenever your cousin wants to use the application. However, in return, you get the flexibility of editing the mac1 any time you want.)

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: help with Locking Java Code to MAC adress
It's not a secret anymore!