C#: Create a virtual drive in Computer

一世执手 提交于 2019-11-27 09:51:22

问题


Is there any way to create a virtual drive in "(My) Computer" and manipulate it, somewhat like JungleDisk does it?

It probably does something like:

override OnRead(object sender, Event e) {
    ShowFilesFromAmazon();
}

Are there any API:s for this? Maybe to write to an XML-file or a database, instead of a real drive.


The Dokan Library seems to be the answer that mostly corresponds with my question, even though System.IO.IsolatedStorage seems to be the most standardized and most Microsoft-environment adapted.


回答1:


You can use the Dokan library to create a virtual drive. There is a .Net wrapper for interfacing with C#.




回答2:


Yes, use the classes in System.IO.IsolatedStorage




回答3:


The contents of My Computer can include Shell Namespace Extensions. These COM objects run inside the main Explorer process, as do many other shell extensions. Using C# for such extensions is a bad idea, since your extension cannot control which CLR version Explorer.exe can use. And Microsoft allows only one CLR per process.



来源:https://stackoverflow.com/questions/56908/c-create-a-virtual-drive-in-computer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!