zoukankan      html  css  js  c++  java
  • 获取系统版本,判断是windows还是Linux

    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;
    		}
    	}
    }
    
  • 相关阅读:
    前端设计工具
    centos7管理用户权限
    搜索个人内容方法
    HDU-6668-Polynomial(数学)
    Gym-100923L-Por Costel and the Semipalindromes(进制转换,数学)
    Gym-100923I-Por Costel and the Pairs(数学,思维)
    Gym-100923A-Por Costel and Azerah(DP)
    CodeForces-585B(BFS)
    CodeForces-437C(贪心)
    CodeForces-449B(单源最短路,思维)
  • 原文地址:https://www.cnblogs.com/gz9218/p/4002bbdf3490bb98a48ab866287f8f19.html
Copyright © 2011-2022 走看看