Java判断当前运行系统是否是windows系统

使用Java类System可以获取到大多数系统信息,因此本次判断运行操作系统是否是windows也可以从System类入手。

具体方法:

	public boolean isWindows() {
		return System.getProperties().getProperty("os.name").toUpperCase().indexOf("WINDOWS") != -1;
	}


猜你喜欢

转载自blog.csdn.net/u014788540/article/details/76255546