[英]How can I get identity of a disk?
I want to identify disk in c++ in my windows application. 我想在Windows应用程序中以c ++标识磁盘。 For example: I have a disk on E:\\ Then I changed the disk, and replace it with another one. 例如:我在E:\\上有一个磁盘,然后更换了磁盘,并用另一个替换它。 the name is still E:\\ How can I know the disk is changed, it is not the original one? 名称仍然是E:\\我怎么知道磁盘已更改,它不是原始磁盘?
If I have no administrator priority in win7, Can I still use some method to identy different disks? 如果我在win7中没有管理员优先级,是否仍可以使用某些方法来标识不同的磁盘?
Many thanks! 非常感谢!
Probably the relevant methods are: 可能的相关方法是:
GetVolumeInformation will give you the serial number. GetVolumeInformation将为您提供序列号。 If this isn't enough you will probably have to resort to WMI_PhysicalMedia . 如果这还不够,您可能不得不诉诸WMI_PhysicalMedia 。 I believe all of this should work without Administrator privileges. 我相信所有这些都应该在没有管理员权限的情况下起作用。
A page listing a bunch of relevant functions is here: http://msdn.microsoft.com/en-us/library/aa365730(v=VS.85).aspx 列出了一系列相关功能的页面在这里: http : //msdn.microsoft.com/zh-cn/library/aa365730(v=VS.85).aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.