All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.chendahai.dingding.utils.SystemMsg Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package cn.chendahai.dingding.utils;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class SystemMsg {
    public static String getHostAddress() {
        String address = "";
        try {
            InetAddress addr = InetAddress.getLocalHost();
            address = addr.getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return address;
    }

    public static void main(String[] args) {
        System.out.println(getHostAddress());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy