C# Open/SaveFileDialog with a different file system

ε祈祈猫儿з 提交于 2019-12-12 00:18:15

问题


I'd like the standard windows open and save file dialogs, however, the particular application I am using it for is a remote file system (basically, I'd love to somehow just provide a IFileSystem interface to SaveFileDialog and have it magically change the files it sees by me providing them). Does anyone know of a complete implementation of those dialogs that supports this functionality? Is there any way to do it with the standard C#/windows dialogs?

If not, I will be implementing the dialog myself. I would still love any resources to implementations of these dialogs, even if they don't support this functionality, just so I could rip them apart and add that functionality myself.

Thanks!


回答1:


The only choice is to implement your own Shell Namespace Extension. It may be registered as a "My Computer" child so it looks like another drive. Beware: this is a tedious work and due to .NET framework limitation (<4.0), it has to be written in C/C++.

Here is the example.




回答2:


These classes are very thin wrappers around calls to native Windows shell api functions. GetOpenFileName() for XP and earlier, the IFileOpenDialog COM interface for Vista and up. If you cannot see the file system in Explorer then those wrappers are not going to be useful at all.



来源:https://stackoverflow.com/questions/10574272/c-sharp-open-savefiledialog-with-a-different-file-system

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