java 获取指定的信息

来源:互联网 发布:全知之眼bgm 编辑:程序博客网 时间:2024/05/22 00:31
1 public class systemdemo {
2 public static void main(String[] args) {
3 System.out.println("系统版本为:"+System.getProperty("os.name")+System.getProperty("os.version")+System.getProperty("os.arch"));
4 System.out.println("系统用户为:"+System.getProperty("user.name"));
5 System.out.println("当前用户目录:"+System.getProperty("user.home"));
6 System.out.println("当前用户工作目录: "+System.getProperty("user.dir"));
7 }
8 }

 

原创粉丝点击