By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,275 Members | 1,899 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,275 IT Pros & Developers. It's quick & easy.

System.Management query

P: n/a

I'm trying to do asynchronous consumption of WMI events using System.Management.

Basically I want to monitor the connection status of Win32_NetworkAdapter. (i.e recieve events when it connects, disconnects)

I tried implementing and changing this code from msdn:

I changed it to use:

Dim query As New WqlEventQuery("__InstanceModificationEvent", "TargetInstance ISA 'Win32_NetworkAdapter'")

The problem is that it demands I use a WITHIN in the WQL (otherwise I get a "HRESULT: 0x80042002" error).

I don't want to use WITHIN because this causes the system to poll and use quite a bit of CPU.

How come the example on MSDN doesn't need WITHIN?

What are my options here? Should I even use System.Management?

Thanks for any help you may have
From: Justin M

Posted by a user from .NET 247 (

Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.