Find all our projects in development below.
All source code is GNU General Public License (GPL)
Browsing clsWMIMethodInvoke.vb (633 B)
Option Explicit On
Imports System.Management
Public Class clsWMIMethodInvoke
Private _objMgmt As ManagementObject = Nothing
Private _methodName As String = Nothing
Public Args As New ArrayList
Public Sub New(ByVal objMgmt As ManagementObject, _
ByVal methodName As String)
_objMgmt = objMgmt
_methodName = methodName
End Sub
Public Sub Execute()
If Args.Count = 0 Then
_objMgmt.InvokeMethod(_methodName, Nothing)
Else
_objMgmt.InvokeMethod(_methodName, Args.ToArray)
End If
End Sub
End Class
Download clsWMIMethodInvoke.vb