WMI = Nothing
Return _WMIList
Catch ex As Exception
MsgBox(ex.Message, 16 + 0, ex.TargetSite.Name)
End Try
End Function
‘获取 WMI 的 Class Info 并将其写入输出窗口
Private Sub GetInfo(ByVal IndexString As String)
Try
If IndexString Is Nothing Then Exit Sub
Dim wmiClass As String = IndexString
WMI = New Management.ManagementClass(wmiClass)
Dim strInfo As String
Console.WriteLine("WMI Class is:" & wmiClass)
For Each info In WMI.GetInstances
‘将 WMI Class Info 写到输出窗口
Console.WriteLine(info.GetText(Management.TextFormat.Mof).ToString)
Next
info = Nothing
WMI = Nothing
Catch ex As Exception
MsgBox(ex.Message, 16 + 0, ex.TargetSite.Name)
End Try
End Sub
---------------------------------------------------------------------------------------
使用时:
Dim tmpStr() As String, i As Integer
''''获取 WMI 的 Class Name
tmpStr = FindWMI(Nothing, True)
''''列出 Class Name Array 中的第 559 个 Class 的 Info
GetInfo(tmpStr(559))
''''列出物理内存的信息
GetInfo("Win32_PhysicalMemory")
上一页 [1] [2] [办公软件]使用TRIMMEAN函数去除几个最高分和几个最低分之后… [操作系统]几个常用的DOS网络命令详解 [网络技术]常被宽带共享上网用户关注的几个问题 [电脑技术]衡量CPU性能的几个参数指标介绍 [电脑技术]使用扫描仪的几个常规高级技巧 [电脑技术]使用电子邮件EMail应注意的几个问题 [VB.NET程序]VB.NET下通过WMI共享文件夹 [VB.NET程序]几个 WMI 的例子(初级) - 2 [VB.NET程序]几个 WMI 的例子(初级) - 3 [VB.NET程序]几个 WMI 的例子(初级) - 4
|