C 獲取硬體資訊

2021-04-18 18:33:41 字數 786 閱讀 2273

using system;

using system.net;

using system.runtime.interopservices;

using system.management; //需要在解決方案中引用system.management.dll檔案

//獲取機器名

public string gethostname()

//獲取cpu編號

public string getcpuid()

return strcpuid;

}catch

}//end method

//獲取第一塊硬碟編號

public string getharddiskid()

return strharddiskid;

}catch

}//獲取網絡卡mac位址

public string getnetcardmac()

}return stringmac;

}catch

}//獲取硬碟資訊的**

public string getvolof(string drvid)

catch

}//獲取當前網絡卡ip位址

public string getnetcardip()

}return stringip;

}catch}}

}

今天以外的需要獲得mac,沒想到找到了這個,還是蠻有意思的!

c 獲取硬體資訊

using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 public string getcpuid return strcpuid catch end m...

c 獲取硬體資訊

using system using system.runtime.interopservices using system.management namespace hardware 取cpu編號 public string getcpuid return strcpuid catch end m...

C 獲取硬體資訊

using system using system.net using system.runtime.interopservices using system.management 需要在解決方案中引用system.management.dll檔案 hardinfoclass 的摘要說明。publi...