java 判断系统版本 打印版本

来源:互联网 发布:软件开发考试培训 编辑:程序博客网 时间:2024/06/10 06:36
 /** 
 * 判断系统版本
 */
public static int osInfo()
{
String name = System.getProperty("os.name");//得到操作系统名字 
String s = System.getProperty("sun.os.patch.level");//得到操作系统版本
if(name.toLowerCase().startsWith("win")){
System.out.println("windows");
}
System.out.println(name);
System.out.println(s);
return 0;
}
0 0
原创粉丝点击