Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Wmi Drive connected, disconnected question

$
0
0

hey

i try to use wmi to hook a Loop, that throw a message if any device is connected or disconnected. This Looks like:

DrivesLoopWatcher_GV = new ManagementEventWatcher(new WqlEventQuery( @"select * from __InstanceOperationEvent within 1 where TargetInstance isa 'Win32_LogicalDisk'"));

DrivesLoopWatcher_GV.EventArrived += (s, e) =>
{ /*do something*/};
DrivesLoopWatcher_GV.Start();

But at Moment i can not make differences if a drive was connected or disconnected. Please don't answer any Kind of "go this other way" answers, cause i not it all Means, sure, i can Loop throw Harddrives and look, but this isn't my question.

With which property, maybe of the EventArgs-Class i can decide what i want???


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>