Win32_DiskDrive 签名属性

发布于 2024-08-03 00:39:42 字数 88 浏览 3 评论 0原文

有谁知道 Win32_DiskDrive WMI 类的 Signature 属性是什么? 它是唯一的还是用户可以像磁盘卷序列号一样更改它?

谢谢。

Does anybody know what is the Signature property of the Win32_DiskDrive WMI class?
Is it unique or users can change it like disk volume serial number?

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

嘦怹 2024-08-10 00:39:43

“签名”属性是随 Windows XP 引入的,用于用作共享群集磁盘的磁盘。根据我的理解,它是在磁盘第一次连接到 Windows 系统时创建的,即使磁盘通过另一个控制器连接(或者在集群场景中,甚至通过另一台计算机)也不会更改。

详细解释参见MSDN:
创建物理磁盘资源
http://msdn.microsoft.com/en-us /library/aa369328(VS.85).aspx

The "Signature" property was introduced with Windows XP and is used for disks that are used as shared cluster disks. In my understanding it is created the first time the disk is connected to a windows system and will not be changed even if the disk is connected via another controller (or in a cluster scenario even via another computer).

For a detailed explanation see MSDN:
Creating Physical Disk Resources
http://msdn.microsoft.com/en-us/library/aa369328(VS.85).aspx

记忆里有你的影子 2024-08-10 00:39:43

我可以通过提供有关“Win32_DiskDrive WMI 类”的一些重要详细信息来帮助您。

将以下代码复制到您的 C# 项目。

    public static string HardDiskID()
    {
        ManagementClass partionsClass = new ManagementClass("Win32_DiskDrive");
        ManagementObjectCollection partions = partionsClass.GetInstances();

        string hdd = string.Empty;

        foreach (ManagementObject partion in partions)
        {
            hdd = Convert.ToString(partion["SerialNumber"]);

            if (hdd != string.Empty)
                return hdd;
        }

        return hdd;
    }

注意 - 上面代码的“SerialNumber”字符串可以替换为以下任何硬盘属性。

  uint16   Availability;
  uint32   BytesPerSector;
  uint16   Capabilities[];
  string   CapabilityDescriptions[];
  string   Caption;
  string   CompressionMethod;
  uint32   ConfigManagerErrorCode;
  boolean  ConfigManagerUserConfig;
  string   CreationClassName;
  uint64   DefaultBlockSize;
  string   Description;
  string   DeviceID;
  boolean  ErrorCleared;
  string   ErrorDescription;
  string   ErrorMethodology;
  string   FirmwareRevision;
  uint32   Index;
  datetime InstallDate;
  string   InterfaceType;
  uint32   LastErrorCode;
  string   Manufacturer;
  uint64   MaxBlockSize;
  uint64   MaxMediaSize;
  boolean  MediaLoaded;
  string   MediaType;
  uint64   MinBlockSize;
  string   Model;
  string   Name;
  boolean  NeedsCleaning;
  uint32   NumberOfMediaSupported;
  uint32   Partitions;
  string   PNPDeviceID;
  uint16   PowerManagementCapabilities[];
  boolean  PowerManagementSupported;
  uint32   SCSIBus;
  uint16   SCSILogicalUnit;
  uint16   SCSIPort;
  uint16   SCSITargetId;
  uint32   SectorsPerTrack;
  string   SerialNumber;
  uint32   Signature;
  uint64   Size;
  string   Status;
  uint16   StatusInfo;
  string   SystemCreationClassName;
  string   SystemName;
  uint64   TotalCylinders;
  uint32   TotalHeads;
  uint64   TotalSectors;
  uint64   TotalTracks;
  uint32   TracksPerCylinder

i can help you with by giving some important details about "Win32_DiskDrive WMI class".

copy following code to your c# project.

    public static string HardDiskID()
    {
        ManagementClass partionsClass = new ManagementClass("Win32_DiskDrive");
        ManagementObjectCollection partions = partionsClass.GetInstances();

        string hdd = string.Empty;

        foreach (ManagementObject partion in partions)
        {
            hdd = Convert.ToString(partion["SerialNumber"]);

            if (hdd != string.Empty)
                return hdd;
        }

        return hdd;
    }

Note--above code's "SerialNumber" string can replace with following any hard disk attributes.

  uint16   Availability;
  uint32   BytesPerSector;
  uint16   Capabilities[];
  string   CapabilityDescriptions[];
  string   Caption;
  string   CompressionMethod;
  uint32   ConfigManagerErrorCode;
  boolean  ConfigManagerUserConfig;
  string   CreationClassName;
  uint64   DefaultBlockSize;
  string   Description;
  string   DeviceID;
  boolean  ErrorCleared;
  string   ErrorDescription;
  string   ErrorMethodology;
  string   FirmwareRevision;
  uint32   Index;
  datetime InstallDate;
  string   InterfaceType;
  uint32   LastErrorCode;
  string   Manufacturer;
  uint64   MaxBlockSize;
  uint64   MaxMediaSize;
  boolean  MediaLoaded;
  string   MediaType;
  uint64   MinBlockSize;
  string   Model;
  string   Name;
  boolean  NeedsCleaning;
  uint32   NumberOfMediaSupported;
  uint32   Partitions;
  string   PNPDeviceID;
  uint16   PowerManagementCapabilities[];
  boolean  PowerManagementSupported;
  uint32   SCSIBus;
  uint16   SCSILogicalUnit;
  uint16   SCSIPort;
  uint16   SCSITargetId;
  uint32   SectorsPerTrack;
  string   SerialNumber;
  uint32   Signature;
  uint64   Size;
  string   Status;
  uint16   StatusInfo;
  string   SystemCreationClassName;
  string   SystemName;
  uint64   TotalCylinders;
  uint32   TotalHeads;
  uint64   TotalSectors;
  uint64   TotalTracks;
  uint32   TracksPerCylinder
小霸王臭丫头 2024-08-10 00:39:43

我将 HDD 带到另一台机器上,签名和 PNPDeviceID 已更改。所以我认为操作系统生成了这个签名。

I take HDD to another machine and Signature and PNPDeviceID CHANGED. So i think OS generates this signature.

陌伤浅笑 2024-08-10 00:39:43

我认为两条评论对于任何走这条道路的人来说都非常重要。

  • 可以使用 diskpart 工具进行更改
  • 通过签名访问它并不可靠 - 请参阅 随机值磁盘签名

Two comments that I think are very important for anyone following this path.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文