See here:
Retrieving IP and MAC addresses for a LAN[
^] - the code is in C#, but it's pretty simple and if you can't work it out, online converter exist which will help:
Code Converter[
^]
If you are planning on using this for a security or copy protection system, you should be aware that MAC addresses are 1) not unique, and 2) easy to spoof.