通过代码,我怎么能发送一个硬盘驱动器入睡 [英] By code, how can I send a hard disk drive to sleep

查看:174
本文介绍了通过代码,我怎么能发送一个硬盘驱动器入睡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多的硬盘驱动器在我的电脑(7)。

I have lots of hard disk drives in my computer (7).

当他们不使用电源选项,给他们一段时间后睡觉。
,而因为一切都使得大量的噪音,我想送他们睡觉时,我想,不只是默认的系统超时后。

When they are not used the power option send them to sleep after a while. But because everything makes a lot of noise I would like to send them to sleep when I want, not just after the default system timeout.

在Windows( XP及以上),最好是在C#中,

On Windows (XP and up), preferably in C#,

我如何发送磁盘通过代码睡觉?

非常感谢提前对你的帮助......

Thanks a lot in advance for your help...

推荐答案

据我所知,这是一个ATA命令那台*降速time8 - 这意味着它是关闭驱动器本身。你可以使用IOCTL_ATA_PASS_THROUGH将命令直接发送到驱动器 - 但是我怕你会做没有不仅仅是将它设置为某些最小值(我不知道它是什么好,但它应该是在ATA规格。)

AFAIK, this is an ATA command that sets the *spin down time8 - meaning it's the drive itself that shuts down. You could use IOCTL_ATA_PASS_THROUGH to send commands directly to the drive - but I'm afraid you'd do no better than just setting it to some min value (which I don't know what it is, but it should be in the ATA specs).

编辑:看起来像古老的 hdparm的支持它,所以它必须在ATA规格:

Looks like the venerable hdparm supports it, so it must be in the ATA spec:

-y
组的IDE驱动器立即进入低功耗待机状态下,通常导致其停止运转。

-y Force an IDE drive to immediately enter the low power consumption standby mode, usually causing it to spin down.

-Y强制的IDE驱动器立即进入最低功耗的睡眠模式,导致其完全关闭。硬或软重置之前,需要的驱动器可再次访问(在需要的时候,如果/ Linux的IDE驱动程序会自动处理发出复位)。

-Y Force an IDE drive to immediately enter the lowest power consumption sleep mode, causing it to shut down completely. A hard or soft reset is required before the drive can be accessed again (the Linux IDE driver will automatically handle issuing a reset if/when needed).

由于 hdparm的(它使用与驱动器通信的底层Linux内核)是GPL的 - 你应该能够从那里婴儿床的细节,如果你没有一个ATA规格得心应手。

Since hdparm (and the underlying Linux kernel it uses to communicate with the drive) is GPL - you should be able to crib the specifics from there if you don't have an ATA spec handy.

或者,只需使用 Win32的移植

这篇关于通过代码,我怎么能发送一个硬盘驱动器入睡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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