package com.bonus.boot.manager.basic.controller;
import java.net.*;
public class ipcc {

        public static void main(String[] args) {

            InetAddress ia=null;

            try {

                ia= InetAddress.getLocalHost();

                String localname=ia.getHostName();

                String localip=ia.getHostAddress();

                System.out.println("本机名称是："+ localname);

                System.out.println("本机的ip是 ："+localip);

            } catch (Exception e) {

                e.printStackTrace();

            }

        }
}
