Here you can find the source of GetMachineAddress()
Parameter | Description |
---|---|
Exception | an exception |
public static String GetMachineAddress() throws Exception
//package com.java2s; // it under the terms of the GNU General Public License as published by import java.net.InetAddress; public class Main { /** Indicates the IP address of the machine where this software is being run *//from w w w .j a v a2s .co m * @return IP address * @throws Exception */ public static String GetMachineAddress() throws Exception { return InetAddress.getLocalHost().getHostAddress(); } }