在 C#.NET 项目中添加 DLL 文件作为参考
我目前正在开发一个在 Microsoft Windows 环境中执行磁盘碎片整理的项目。为此,我想使用 Windows 碎片整理实用程序的内置功能。我在某处读到 Windows 使用“dfrgres.dll”文件来执行碎片整理。所以,我想在我的项目中添加“dfrgres.dll”文件作为参考。但我不能这样做。这是当我尝试将指定的 DLL 添加到我的项目中时收到的错误消息:
“无法添加对 '...\dfrgres.dll' 的引用。请确保该文件可访问,并且它是有效的程序集或 COM 组件”
请告诉我问题出在哪里...或者还有其他方法吗...???互联网上是否还有其他开源资源可用于碎片整理......???
问候,
难以捉摸的先生
I am currently working on a project to perform disk defragmentation in Microsoft Windows environment. For that I want to use the in-built functions of the Windows defragmentation utility. I read somewhere that Windows uses "dfrgres.dll" file to perform defragmentation. So, I want to add "dfrgres.dll" file as a reference in my project. But I am not able to do so. This is the error message which I am getting when I try to add the specified DLL into my project:
"A reference to '...\dfrgres.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component"
Please tell me where the problem is...or is there any other way to do it...??? Are there any other open source resources available over the internet for defragmentation...???
Regards,
Mr. Elusive
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有专用的 DLL 或 COM 服务器来执行碎片整理,低级接口使用 IOCTL 代码与设备驱动程序通信。 此处简要描述 。
有一位 Microsoft 员工博客文章提出了C# 接口。不知道它是否仍然适用于更高版本的 Windows。
There is no dedicated DLL or COM server to perform defrag, the low-level interface uses IOCTL codes to talk to the device driver. Briefly described here.
There's a Microsoft employee blog post that proposes a C# interface. No idea if it still works on later versions of Windows.