O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Reflect on a WMI Class

Problem

You want to use reflection to retrieve information about a Windows Management Instrumentation (WMI) class.

Solution

Create a ManagementClass object for the WMI class, and then explore it using properties such as ManagementClass.Methods, ManagementClass.Properties, MethodData.InParameters, and MethodData.OutParameters.

Discussion

Windows Management Instrumentation is a core component of the Windows operating system that allows your code to retrieve a vast amount of system and hardware information using a query-like syntax. The basic unit of WMI is the WMI class, which is similar to a .NET class, exposing properties and methods. However, you can’t use a WMI class directly from .NET code; instead, you access a WMI class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required