我试图获得《事件法》的价值(这是一股):
private static void EventLogMonitor(object sender, EventArrivedEventArgs e)
{
ManagementBaseObject targetInstance = (ManagementBaseObject)e.NewEvent.GetPropertyValue("TargetInstance");
EventId = (int)(targetInstance.GetPropertyValue("EventCode"));
...
但是,在<代码>(int)(目标设计.GetPropertyValue (“EventCode”)上,我获得了一个无效的例外。 似乎这部法典是个目标,我想知道,如何利用《事件守则》的价值?