java怎么獲取硬件信息
java怎么獲取硬件信息
你們知道電腦的硬件信息怎么獲取嗎,下面是學習啦小編帶來java怎么獲取硬件信息的內容,歡迎閱讀!
java怎么獲取硬件信息?
IMonitorService接口:
public interface IMonitorService {
public MonitorInfoBean getMonitorInfoBean() throws Exception;
}
MonitorInfoBean類:
/*采集系統(tǒng)存取數(shù)據(jù)JavaBean*/
public class MonitorInfoBean implements Comparable<MonitorInfoBean> {
/** 操作系統(tǒng). */
private String osName;
/** 總的物理內存. */
private float totalMemorySize;
/** 已使用的物理內存. */
private float usedMemory;
/** cpu使用率. */
private double cpuRatio;
/** 主機IP地址 */
private String mIpAddress;
/** 數(shù)據(jù)存儲時間 */
private String dDateTime;
/**內存使用率*/
private float memoryRatio;
/**linux下Buffers內存*/
private float buffersMemory;
/**linux下Cached內存*/
private float cachedMemory;
public float getBuffersMemory() {
return buffersMemory;
}
public float getCachedMemory() {
return cachedMemory;
}
public String getDDateTime() {
return dDateTime;
}
public void setDDateTime(String dateTime) {
dDateTime = dateTime;
}
public String getMIpAddress() {
return mIpAddress;
}
public void setMIpAddress(String ipAddress) {
mIpAddress = ipAddress;
}
public String getOsName() {
return osName;
}