Generic WMI Coding Techniques using VB.Net

Category:
C#, VB.NET, ASP.NET
Type:
Snippets
Difficulty:
Advanced
Author:
Anonymous

Version Compatibility: Visual Basic.NET

More information:
This code snippet shows a technique of passing multiple WMI requests into generic WMI processing code. By passing in different classes and parameters to a generic method, the code is easy to maintain and reuse. For example in the two separate calls to processMetrics the below example targets two different WMI classes. The code can be easily extended to map to any number of different WMI classes.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: