获得硬盘速度 [英] Getting Hard Disk Speed

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

问题描述

嗨!



可以使用C#获取硬盘信息吗?



燃烧速度硬盘

和RPM一样旋转率

型号

公司名称

数据传输率

寻求时间



我尝试过使用

Hi!

It is possible to get Hard Disk Information using C#?

Burning Speed of Hard Disk
Like spin rate in RPM
Model Number
Company Name
Data Transfer Rate
Seek Time

I have tried with

ManagementClass driveClass = new ManagementClass("Win32_DiskDrive");



属性,但它没有给出旋转率。



请帮助我?



- Dattatrya Moin


properties but it's not giving spin rate.

Please help me?

- Dattatrya Moin

推荐答案

请参考以下链接..









http://bytes.com/topic/c-sharp/answers/251179-how-measure-hard-disk-capacity [ ^ ] http://stackoverflow.com/questions/5675761/serial-number-of-hard-disk-or-硬盘驱动器



http://www.eggheadcafe.com/community/csharp/2/13409/retrieving-hardware-identifiers-in-c-with-wmi.aspx [ ]



在C#中检索硬件信息 [ ]
Please refer the following links..




http://bytes.com/topic/c-sharp/answers/251179-how-measure-hard-disk-capacity[^]http://stackoverflow.com/questions/5675761/serial-number-of-hard-disk-or-hard-drive

http://www.eggheadcafe.com/community/csharp/2/13409/retrieving-hardware-identifiers-in-c-with-wmi.aspx[]

Retrieving Hardware Information in C#[]


你好



查看获取硬盘速度的链接:


您好,

使用System.Management.ManagementClass获取与H / W相关的信息。来自一个系统。



只是为了简要介绍这个主题,下面的例子将为您提供连接到计算机的所有硬盘驱动器的完整信息。



Hi,
Use System.Management.ManagementClass to get the H/W related info. from a system.

just to brief the topic, below is the example that will give you the full info of all the Hard Drives connected to a computer.

static void Main(string[] args)
        {
            
            System.Management.ManagementClass mgmtClass = new System.Management.ManagementClass("Win32_DiskDrive");
            System.Management.ManagementObjectCollection mgmtObjCol = mgmtClass.GetInstances();

            foreach (System.Management.ManagementObject MGMTOBJ in mgmtObjCol)
            {                
               Console.WriteLine(MGMTOBJ.ToString());
                foreach (System.Management.PropertyData property in MGMTOBJ.Properties)
                {                   
                    Console.WriteLine("Property Name: "+property.Name+"\tProperty Value: "+property.Value);
                }
                
            }



实际上可以获取所有信息,这可能取决于操作系统。在Linux上你可以阅读/ proc下的一些文件。



是的,使用Mono,你在Linux上得到C#。


actually to get all the information, It probably depends upon the operating system. On Linux you might read some files under /proc using.

And yes,with Mono, you get C# on Linux.


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

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