Thread: Anyone know the method for this?

Results 1 to 3 of 3
  1. #1 Anyone know the method for this? 
    Member
    Join Date
    Nov 2011
    Posts
    587
    Thanks given
    54
    Thanks received
    17
    Rep Power
    0
    getMACAddress for player.java i need the method for it :/
    Reply With Quote  
     

  2. #2  
    Banned

    Join Date
    Jun 2012
    Posts
    1,063
    Thanks given
    119
    Thanks received
    199
    Rep Power
    0
    Code:
    public String getMacAddress() {
        try {
            InetAddress a = connectedLocal;
            NetworkInterface n = NetworkInterface.getByInetAddress(a);
            byte[] m = n.getHardwareAddress();
            StringBuilder sb = new StringBuilder();
                for (int i = 0; i < m.length; i++) {
                sb.append(String.format("%02X%s", m[i], (i <m.length - 1) ? "-" : ""));
                }
                connectedMac = sb.toString();
        } catch (SocketException e) {
            e.printStackTrace();
        }
        return connectedMac;
    }
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Member
    Join Date
    Nov 2011
    Posts
    587
    Thanks given
    54
    Thanks received
    17
    Rep Power
    0
    :/ wait this did not help. i Don't mean Mac as in the type of pc... I need MACAddress as in like the computer ip or w/e.

    I added this and it did not work. :/
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 5
    Last Post: 09-05-2011, 11:21 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •