views:

4304

answers:

5

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.

+4  A: 

Yes, use the classes in System.IO.IsolatedStorage

C. Lawrence Wenham
+6  A: 

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

Joel Lucsy
As far as I know there is no way to use it in a commercial project, it is under LGPL license. I would suggest using WebDAV server + built-in Windows/Mac OS X drive mounting functionality. Probably this is the fastest way to achieve the result.
I think you mix things: LGPL is not incompatible with a commercial usage. You can link against the dll (reference it) and only if you make changes to the Dokan dll itself you must release the source: but the source of the modified Dokan library ONLY! THIS IS NOT THE CASE FOR **GPL** CODE, FOR GPL YOU MUST RELEASE THE SOURCE OF **YOUR** WHOLE APPLICATION.
jdehaan
A: 

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.

Seb Nilsson
A: 

How would the isolated storage create a drive icon?

A: 

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.

MSalters