Enumerating Objects

It’s easy to enumerate all the objects, such as Win32_LogicalDisk, that are available to you. The third page in my WMI demo program does just this, and can be seen running in Figure 19.4. The reported list of objects is very long, and they won’t all fit in a single browser screen—that’s why you can’t see all the objects in the figure.

Figure 19.4. All the WMI objects have been enumerated.

The code for the page in Figure 19.4 can be seen in Listing 19.4. The code starts off by creating a new ManagementClass object. It then creates an EnumerationOptions class, and the EnumerateDeep property is set to false. Then, walking through ...

Get Special Edition Using® Microsoft® ASP.NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.