能不能用VC++5.0得到光盘的卷标
编号:QA001215
建立日期: 1999年6月21日 最后修改日期:1999年6月21日
所属类别:
zhaowei:
VC++5.0
pwin98
能不能用VC++5.0得到光盘的卷标?
回答:
你可以使用GetVolumeInformation来得到磁盘的卷标。下面是GetVolumeInformation的定义:
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName, // address of root directory of the file system
LPTSTR lpVolumeNameBuffer, // address of name of the volume
DWORD nVolumeNameSize, // length of lpVolumeNameBuffer
LPDWORD lpVolumeSerialNumber, // address of volume serial number
LPDWORD lpMaximumComponentLength, // address of system's maximum filename length
LPDWORD lpFileSystemFlags, // address of file system flags
LPTSTR lpFileSystemNameBuffer, // address of name of file system
DWORD nFileSystemNameSize // length of lpFileSystemNameBuffer
);
其中lpVolumeNameBuffer得到的是卷标。对于数据光盘,你得到的卷标,而对于音乐CD,得到的卷标永远是Audio CD。这也可以用来区分光盘的类型。
此问题由李海回答。
| |
|
|
| |
|
|