Public Class EventHandler
   
Public Sub HandleEvent(ByVal sender As ObjectByVal 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事件变化的属性了,
Posted on 2004-08-29 07:09  Jason's WMI SQL Related Blog  阅读(994)  评论(0)    收藏  举报