映射到程序的虚拟驱动器
是否可以创建一个程序(最好是.NET)来创建虚拟驱动器号,但在读取、写入或浏览它时,有一个独立的程序处理返回的内容?
虽然您可以通过将驱动器映射到 TCP 服务器、webDAV 或类似的东西来完成此操作,但我想知道是否可以通过内部链接来完成。
这将用于受保护的存储。如果程序已输入密码,则该程序会对驱动器中的所有文件进行流式加密和解密(因为它们被各种程序读取)。
Would it be possible to create a program (.NET preferably) to create a virtual drive letter, but when it is read, written to, or browsed an independent program deals with what is returned?
Although you could do it by mapping a drive to a TCP server, webDAV or something like that, I'm wondering if it could be done with internal links.
This would be used for protected storage. The program does stream encryption and decryption of all the files in the drive (as they're read by all kinds of programs) if the program has had a password put into it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您所说的是存储设备驱动程序,Daemon Tools 和 TrueCrypt 等程序就是通过它来完成此类“虚拟”驱动器的。
不过,您可能不必深入研究内核即可完成此操作。 Microsoft 提供了 Windows 用户模式驱动程序框架,旨在简化某些常见 Windows 驱动程序类型的开发。据我所知,您应该能够使用用户模式驱动程序框架开发虚拟存储驱动程序。只要您不直接与硬件交互(就像内核模式设备驱动程序那样),就应该没问题。但是,您无法在 C# 中执行此操作。您可能必须使用 C,尽管您可能会使用 C++。
What you're talking about is a storage device driver, which is how programs such as Daemon Tools and TrueCrypt accomplish such "virtual" drives.
You may not have to delve into the kernel to accomplish this, though. Microsoft supply a Windows User-Mode Driver Framework, which is designed to simplify the development of certain common Windows driver types. From what I can tell, you should be able to develop a virtual storage driver using the user-mode driver framework. As long as you're not directly interacting with hardware (like a kernel-mode device driver does), you should be fine. However, you won't be able to do this in C#. You'd probably have to use C, though you might get away with C++.
PowerShell 已经通过其 Provider 模型支持类似的功能。证书存储、Active Directory、IIS 配置、SharePoint 等都看起来像文件系统,使用相同的命令进行查询和更新。
这是 PowerShell 的核心。
$foo
是变量foo
的值,${c:\foo.txt}
是文件C:\ 的内容foo.txt
但就像变量一样使用。同样,dir HKLM:\Software
列出了该注册表项的子项。您可以编写自己的提供程序。
PowerShell already supports something like this with its Provider model. Certificate store, Active Directory, IIS configuration, SharePoint, ... are all made to look file system like, using the same commands to query and update.
This is at the heart of PowerShell.
$foo
is the value of variablefoo
,${c:\foo.txt}
is the content of fileC:\foo.txt
but used just like a variable. Equallydir HKLM:\Software
lists the child keys of that registry key.You can write you own providers.
有一个开源程序 WinCDEmu 可以将 ISO 映像挂载到虚拟驱动器。我想您将能够检查源代码以找出如何提供满足您需求的虚拟驱动器。该项目是用 C++ 编写的。
它基于 BazisLib,这是一个用于简化 Windows 驱动程序开发的框架。
There is an open source program, WinCDEmu that can mount an ISO image to a virtual drive. I suppose you'll be able to examine the sources to figure out how to provide a virtual drive that does what you want. The project is written in C++.
It is based on BazisLib, which is a framework for simplifying windows driver development.