利用java如何知道系统的分区表,例如再windons下有c,d,e三个分区,如何通过java知道。再例如,加入了一个可移动磁盘(U盘)怎么样通过java检测到系统新增加了一个可移动磁盘

解决方案 »

  1.   

    Java是无法知道分区表的,有多少个盘可以使用File.listRoot得到。可以定时调用这个方法,如果增加了就可以知道多了一个盘
      

  2.   

    The System#getenv() can offer you specific CPU and OS information. The System#getProperty() can offer you specific OS information. The java.io.File API can offer you global disk information. The only what's missing in the standard API is the OS-level memory information and the other hardware components and peripherals (graphics card, network card, etc).You can consider using JNI to call some 3rd party libraries which can give more detailed information, e.g. Win32 API, but that's operating system dependent - which on its turn you can determine by System#getenv() and #getProperty().好像确实是不可以得到硬件方面的信息,除非你用c/c++.
      

  3.   

    可以参考jDiskReport 程序
       很不错的图形界面