Get specifics about operating system

前端 未结 2 1066
走了就别回头了
走了就别回头了 2021-01-06 20:22

I thought this would be easy but I can\'t figure this out.

How to tell if using Win7 or WinXP? Like details on operating system. Linux should give specifics. Mac OS

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-06 20:54

    You can use the system info service. To get the OS version

    Services.sysinfo.getProperty("version");
    

    Consult the sources for the properties supported. Also pay attention to their platform-specific meaning (e.g. on Android there is version and kernel_version)

提交回复
热议问题