开发者

How to know what type of optical media is in the drive using .net

After taking a loo开发者_StackOverflowk at the information available in the WMI I discovered that there was no difference in the listed properties between having a CD R disk inserted or a DVD R inserted so WMI doesn't seem to know this information.

However, in Windows 7 with auto-play turned on it always pops a dialog that knows the media type and even if it is a blank disk. Also Windows explorer knows the difference. Anybody know how to access this information through system calls or directly in .Net (2.0, 3.0, 3.5, or 4.0)


For this you need to access IMAPI v2, for which there is no offical .net warpper.

Heres a link to IMAPI doc.

http://support.microsoft.com/kb/KB932716

Having said that, i've used this before

http://www.vbaccelerator.com/home/net/code/libraries/writing_cds/imapi/article.asp

You'll need the DiscRecorder functiom, and you can download a sample app using this wrapper from the left hand sidebar.

Hope that helps..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜