1.ç¨vb.netå¦ä½åå¾macå°åï¼
2.vb2013 如何获得显卡GPU温度
ç¨vb.netå¦ä½åå¾macå°åï¼
è¿æ¯C#çï¼ä½ å¯ä»¥è½¬æ¢ä¸ä¸
using System.Management;
//è·åç½å¡çç³»åå·
private static string GetMacAddress()
{
string ret = "";
try
{
ManagementClass cimobject = new ManagementClass("Win_NetworkAdapterConfiguration");
ManagementObjectCollection moc = cimobject.GetInstances();
if (moc.Count == 0)
return "";
else
{
foreach (ManagementObject mo in moc)
{
if ((bool)mo["IPEnabled"] == true)
{
ret = (string)mo.Properties["MacAddress"].Value;
break;
}
}
}
}
catch
{
ret = "";
}
return ret;
}
vb 如何获得显卡GPU温度
利用 WMI。
.NET 中有个命名空间是源源码美房圈源码 System.Management.ManagementObjectSearcher,可以进行相关硬件设备信息的实例php影视站源码读取。
代码参考:
Dim CPUtprt As Double = 0Dim mos As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("root\WMI",基于多人射击游戏源码 "Select * From MSAcpi_ThermalZoneTemperature")
For Each mo As System.Management.ManagementObject in mos.Get
CPUtprt = Convert.ToDouble(Convert.ToDouble(mo.GetPropertyValue("CurrentTemperature").ToString()) - ) /
Console.Write("CPU 温度 : " & CPUtprt.ToString & " °C")
Next
注:以上代码为我对照 C# 转换过来的,未经过 IDE 环境下测试。源源码上海拍牌 源码
实例夏哥源码下载实例夏哥源码下载