admin
2019-02-27 d2ee731b6a64fa002bceddebf0cc59c78b6c17ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.yeshi.utils;
 
public class SystemUtil {
    public final static int SYSTEM_WINDOWS = 1;
    public final static int SYSTEM_LINUX = 2;
 
    /**
     * 获取操作系统类型
     * 
     * @return
     */
    public static int getSystemType() {
        String os = System.getProperty("os.name");
        if (os.toLowerCase().startsWith("win"))
            return SYSTEM_WINDOWS;
        else
            return SYSTEM_LINUX;
    }
 
}