硬盘的总大小 [英] Total size of a harddisk

查看:85
本文介绍了硬盘的总大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我正在寻找一种方法来查找硬盘的总大小(c#)

我不想要分区的大小!但是磁盘的实际大小。 (hdd总大小GB)



请帮帮我..

Hi all,

I''m looking for a way to find the total size of a harddisk (c#)
I don''t want the size of the partitions !!! but the "real size" of the disk. (hdd total size GB)

please help me..

推荐答案

请通过以下链接希望这会对你有所帮助......



硬盘总大小



谢谢!!
Please go through the below link.. Hope this will help you...

Total Size of hard disk

Thank you!!


查看对此问题的回答查找所有驱动器大小硬盘 [ ^ ]
See the responses to this question Finding All Drive Size From Hard disk [^]


CodeProject上有一些关于此的文章:



最好的一个我发现是这个(C ++)

Get Physical没有WMI的硬盘序列号 [ ^ ]



或者这个使用C#

如何检索REAL硬盘驱动器序列号 [ ^ ]



这将为您提供物理磁盘列表和每个物理磁盘的一些属性。





继承人使用简单的脚本WMI:



There are a few articles about this here on Codeproject:

The best one I found is this (C++)
Get Physical HDD Serial Number without WMI[^]

Or this one using C#
How to Retrieve the REAL Hard Drive Serial Number[^]

This will give you a list of physical disks and some properties about each one.


And heres a simple script using WMI:

var searcher = new ManagementObjectSearcher(@"select * from Win32_DiskDrive");
foreach (ManagementObject obj in searcher.Get())
{
    Console.WriteLine("Name:{0}", obj["Name"]);
    Console.WriteLine("Size:{0}", obj["Size"]);
}


这篇关于硬盘的总大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆