Public Class EventHandler
Public Sub HandleEvent(ByVal sender As Object, ByVal e As EventArrivedEventArgs)
'Get the Event object and display it
Dim pd As PropertyData
pd = e.NewEvent.Properties("TargetInstance")
If pd Is "" Then
Else
Dim mbo As ManagementBaseObject
mbo = pd.Value
'OutPut the properties.
Console.WriteLine(mbo.Properties("Caption").Value & mbo.Properties("ExecutablePath").Value)
End If
End Sub
End Class可以传递出WMI事件变化的属性了,

浙公网安备 33010602011771号