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,可以进行相关硬件设备信息的实例挂源码怎么使用读取。
代码参考:
Dim CPUtprt As Double = 0Dim mos As System.Management.ManagementObjectSearcher = New System.Management.ManagementObjectSearcher("root\WMI",基于php主机卫士源码 "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 环境下测试。源源码vue开发app源码
实例芸众源码下载实例芸众源码下载2024-11-26 20:53
2024-11-26 20:43
2024-11-26 20:30
2024-11-26 20:17
2024-11-26 19:56
2024-11-26 18:25