- how to get ip address in java
import java.net.InetAddress; public class GetIPAddress { public static void main(String[] args) { try { InetAddress thisIp = InetAddress.getLocalHost(); System.out.println("IP:" + thisIp.getHostAddress()); } catch (Exception e) { e.printStackTrace(); } } }
댓글 없음:
댓글 쓰기