cd insert/remove events

S

sanjana

hi
i m trying to detect CD insert removal events via the system.management
n i m using in the query 'Win32_LogicalDisk'

When i try to access the property of these class like Size ..
it give me THE USED SPAce in the cd

doubt:
however when i try to access the property of these class like
MaxMediaSize ..
it give me an error "NOT fOUND" y????????????

when i try to access the property of these class like FreeSpace..
it always gives me the value as 0 y????????????????

here is the part of the code
ManagementObject mo = new
ManagementObject("Win32_LogicalDisk.DeviceId='D:'");

mo.Get();

UInt64 ulngFreeSpace = (UInt64) mo["FreeSpace"];
UInt64 ulngmediaSpace = (UInt64) mo["MaxMediaSize"];

thanx
 
W

Willy Denoyette [MVP]

Please don't multipost, also you should post WMI related question to the WMI
specific NG microsoft.public.dotnet.framework.wmi

Willy.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top