0

我正在尝试从 vb.net 的设备管理器中获取“最后到达日期”属性。我已经用 Win32_PnPEntity 试过了,但不包括这个属性。是否有其他功能可以获取此属性?

我需要这个来检查“NI PXI Express 机箱”已经打开了多长时间。它通过 Thunderbolt 连接并包含一个数字万用表,需要 30 分钟的预热时间。所以在我开始测量之前,我必须检查预热时间是否已经结束。

这是我的代码实际代码,但正如我所说,它不提供此属性:

    Dim path As System.Management.ManagementPath = New ManagementPath()
    path.Server = "."
    path.NamespacePath = "root\CIMV2"
    Dim scope As ManagementScope = New ManagementScope(path)
    Dim query As ObjectQuery = New ObjectQuery("SELECT * FROM Win32_PnPEntity WHERE Name LIKE 'NI PXI Express Chassis Control Device'")
    Dim searcher As ManagementObjectSearcher = New ManagementObjectSearcher(scope, query)
    Dim queryCollection As ManagementObjectCollection = searcher.Get()
    Dim m As ManagementObject
    For Each m In queryCollection
        Console.WriteLine("Device Name : {0}", m("Name"))
        Console.WriteLine("Availability : {0}", m("Availability"))
        Console.WriteLine("Caption : {0}", m("Caption"))
        Console.WriteLine("ClassGuid : {0}", m("ClassGuid"))
        Console.WriteLine("CompatibleID : {0}", m("CompatibleID"))
        Console.WriteLine("ConfigManagerErrorCode : {0}", m("ConfigManagerErrorCode"))
        Console.WriteLine("ConfigManagerUserConfig : {0}", m("ConfigManagerUserConfig"))
        Console.WriteLine("CreationClassName : {0}", m("CreationClassName"))
        Console.WriteLine("Description : {0}", m("Description"))
        Console.WriteLine("DeviceID : {0}", m("DeviceID"))
        Console.WriteLine("ErrorCleared : {0}", m("ErrorCleared"))
        Console.WriteLine("ErrorDescription : {0}", m("ErrorDescription"))
        Console.WriteLine("HardwareID : {0}", m("HardwareID"))
        Console.WriteLine("InstallDate : {0:G}", m("InstallDate"))
        Console.WriteLine("LastErrorCode : {0}", m("LastErrorCode"))
        Console.WriteLine("Manufacturer : {0}", m("Manufacturer"))
        Console.WriteLine("Name : {0}", m("Name"))
        Console.WriteLine("PNPClass : {0}", m("PNPClass"))
        Console.WriteLine("PNPDeviceID : {0}", m("PNPDeviceID"))
        Console.WriteLine("PowerManagementCapabilities : {0}", m("PowerManagementCapabilities"))
        Console.WriteLine("PowerManagementSupported : {0}", m("PowerManagementSupported"))
        Console.WriteLine("Present : {0}", m("Present"))
        Console.WriteLine("Service : {0}", m("Service"))
        Console.WriteLine("Status : {0}", m("Status"))
        Console.WriteLine("StatusInfo : {0}", m("StatusInfo"))
        Console.WriteLine("SystemCreationClassName : {0}", m("SystemCreationClassName"))
        Console.WriteLine("SystemName : {0}", m("SystemName"))

    Next
    Console.ReadLine()

我需要的财产: 截图设备管理器

谢谢你的帮助。

4

0 回答 0