简体   繁体   English

使用OpenFileDialog和dropnet c#打开Dropbox文件

[英]Open dropbox file with OpenFileDialog and dropnet c#

I'm creating ac# winforms desktop program with dropbox support. 我正在创建具有Dropbox支持的ac#winforms桌面程序。 The problem comes in where the user must select the file (from dropbox) that he would like to open. 问题出在用户必须在其中选择他要打开的文件(从保管箱)的地方。 Is it possible to use the OpenFileDialog to display the content of the person's dropbox account? 是否可以使用OpenFileDialog显示此人的保管箱帐户的内容? I know you can just direct the openFileDialog to the local dropbox folder, but I don't want to do that. 我知道您可以将openFileDialog定向到本地dropbox文件夹,但是我不想这样做。 This will mean that the person must have dropbox installed on that computer before they can use this function of my program. 这意味着该人必须在该计算机上安装了保管箱,然后才能使用我的程序的此功能。 If you can't do this, how will you use tree and list views to create your own openFileDialog? 如果无法执行此操作,将如何使用树形视图和列表视图创建自己的openFileDialog? I would like to keep the design the same as the standard openFileDialog. 我想保持设计与标准openFileDialog相同。 I have read that you can create a rapper class for customising the openFileDialog but don't know how this will work. 我读过您可以创建一个用于定制openFileDialog的说唱歌手类,但不知道它如何工作。

I have looked on google but can't find what I'm looking for. 我看过Google,但是找不到我要的东西。 Any advice or examples will be appreciated. 任何建议或示例将不胜感激。

I'm using dotnet 4.5 and the dropnet library. 我正在使用dotnet 4.5和dropnet库。

Thank you 谢谢

OpenFileDialog only shows existing files. OpenFileDialog仅显示现有文件。

Your program can act like drop box client application and load all files to the client in a local folder. 您的程序可以像投递箱客户端应用程序一样,将所有文件加载到本地文件夹中的客户端。 Then when you show the OpenFileDialog you can set that folder as InitialDirectory of the file dialog. 然后,当您显示OpenFileDialog ,可以将该文件夹设置为文件对话框的InitialDirectory

Also if you don't want to load all files, you can create dummy (empty) files on the local folder and after the user choose to show the file from OpenFileDialog , then download the file and show it to the user. 同样,如果您不想加载所有文件,则可以在本地文件夹上创建虚拟(空)文件,然后在用户选择从OpenFileDialog显示文件之后,再下载文件并将其显示给用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM