java SystemUtil操作系统工具类源码

package com.util
public class SystemUtil{
    /**
    * 判断操作系统
    * @return boolean true=windows false=linux
    */
    public static boolean isWindowsOS() {
        boolean isWindowsOS = false;
        String osName = System.getProperty("os.name");
        if (osName.toLowerCase().indexOf("windows") > -1) {
            isWindowsOS = true;
        }
        return isWindowsOS;
    }
}
发布了34 篇原创文章 · 获赞 1 · 访问量 1945

猜你喜欢

转载自blog.csdn.net/qq_38974638/article/details/105429099