package com.foresee.zxpt.common.utils;

import java.util.Properties;

/**
 * 获取系统版本
 * @author GZ
 *
 */
public class OSUtils {

	/**
	 * 判断是否是Linux
	 * @return
	 */
	public static boolean isOSLinux() {
        Properties prop = System.getProperties();

        String os = prop.getProperty("os.name");
        if (os != null && os.toLowerCase().indexOf("linux") > -1) {
            return true;
        } else {
            return false;
        }
    }
	
	/**
	 * 判断是否是windows
	 * @return
	 */
	public static boolean isOSWin() {
		Properties prop = System.getProperties();
		
		String os = prop.getProperty("os.name");
		if (os != null && os.toLowerCase().startsWith("win")) {
			return true;
		} else {
			return false;
		}
	}
}

相关文章:

  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2021-10-16
猜你喜欢
  • 2021-10-24
  • 2022-12-23
  • 2021-11-07
  • 2021-07-25
相关资源
相似解决方案