如何得到光盘类型?

milk2009 2008-04-16 09:43:43
请问有没有什么办法得到插入光盘的光盘类型?比如插入的是cd,cd-r,dvd-r,dvd+r,dvd-rw,dvd+rw,能够知道.谢谢
...全文
233 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Kudeet 2008-04-17
  • 打赏
  • 举报
回复
还顶,看来你是一个都没有研究

:)
milk2009 2008-04-17
  • 打赏
  • 举报
回复
顶上去
Comeon_01 2008-04-17
  • 打赏
  • 举报
回复
GetDriveType(路径)
可以得到诸如:DRIVE_CDROM等参数类型,就可以判断了,但是可能没有你要求判断的那么精确。
Comeon_01 2008-04-17
  • 打赏
  • 举报
回复
GetDriveType(路径)
可以得到诸如:DRIVE_CDROM等参数类型,就可以判断了,但是可能没有你要求判断的那么精确。
ToperRay 2008-04-17
  • 打赏
  • 举报
回复
mark
Kudeet 2008-04-16
  • 打赏
  • 举报
回复
从CODEGURU上找到一个Reply:

1. go walking thru the registry as suggested.
2. use WMI should be Win32_CDRomDrive (or something to that effect) (near same as 1, but a cleaner interface, plus easier in a distrubuted network of windoze platforms)
3. investigate the mcixxx command strings
4. Use DeviceIoControl with IOCTL_STORAGE_GET_MEDIA_TYPES_EX and pass GET_MEDIA_TYPES
only problem there is it's fine to get the OR'd values for MEDIA_XXX such as mounted, can read, can write,
but I believe there is an enumeration member which identifies the drive, such as DVD ROM, DVD write, CDROM, CDW and various vendor specifics,
so you may get a value back that you don't have a description for, so you'd have to find an updated enumeration for STORAGE_MEDIA_TYPE.

1、用WMI
2、用mciXXXX系列命令
3、查找注册表
4、用DeviceIoControl API函数

http://www.codeguru.com/forum/archive/index.php/t-273562.html
Kudeet 2008-04-16
  • 打赏
  • 举报
回复
试试Advanced SCSI Programming Interface http://www.zianet.com/jgray/dat/files/aspi32.pdf
scq2099yt 2008-04-16
  • 打赏
  • 举报
回复
UP

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧