gpt4 book ai didi

c# - 如何获得硬盘传输模式?

转载 作者:搜寻专家 更新时间:2023-10-31 00:56:31 25 4
gpt4 key购买 nike

我需要获取硬盘传输模式(dma 或 pio)并打印它,您可以在设备管理器中找到它(屏幕截图中的红色圆圈)。 AtaScreen

所以我需要从程序中获取红色圆圈中的信息。我试过使用 wmi 类,但 Win32_DiskDrive、Win32_IDEController 和其他类没有提供我需要的信息。最接近设备管理器属性窗口的是 Win32_IDEController,字段 Win32_IDEController["Name"] 返回字符串 ATA Channel 1

我还找到了这个 https://msdn.microsoft.com/en-us/library/windows/hardware/ff550142(v=vs.85).aspx , 但它使用 irb.h,它是 ddk(wdk) 的一部分,我以前从未使用过它,所以我什至不知道如何使用这个函数。

现在我正在学习 WDK)任何语言的任何解决方案都很好,在我使用 C# 的项目中,但如果解决方案将使用另一种语言,我可以将“DMA”或“PIO”写入文件这个解决方案,从 C# 中执行 .exe 并从文件中读取。 C# 中的 OFC 解决方案将受到更多赞赏。

最佳答案

您可以使用 autoit ( https://www.autoitscript.com ) 直接从 GUI 读取它。

示例(注意不同的 Windows 版本和不同的语言):

    Run ("mmc c:\windows\system32\devmgmt.msc") 
WinWaitActive ( "Device Manager" )
send("{tab}{down}{down}{down}{down}{down}{down}{down}{NUMPADADD}{down}!{enter}")
WinWaitActive ( "Primary IDE Channel Properties" )
send("^{tab}")
$drivemode = ControlGetText("Primary IDE Channel Properties", "", "Static4")
ControlClick("Primary IDE Channel Properties","Cancel","Button6")
WinKill ( "Device Manager" )

如果您想在 C# 中使用 Autoit:

https://www.autoitscript.com/forum/topic/177167-using-autoitx-from-c-net/

关于c# - 如何获得硬盘传输模式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39426723/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com