简体   繁体   English

Rackspace CloudFiles C#API:如何在根“文件夹”中列出文件,以及如何在“文件夹”中列出(子)文件夹?

[英]Rackspace CloudFiles C# API: How to list files on root 'folder', and how to list (sub)folders within a 'folder'?

(1) I can list the files on a folder this way: (1)我可以这样列出文件夹中的文件:

var parameters = new Dictionary<GetListParameters, string>();
parameters.Add(GetListParameters.Path, "folder1/"); // get items from this specific path 
var containerItemList = connection.GetContainerItemList(Settings.ContainerName, parameters);

However, this: 但是,这:

parameters.Add(GetListParameters.Path, "/");

or this: 或这个:

parameters.Add(GetListParameters.Path, "");

does not work. 不起作用。
How can I query the files on the root folder? 如何查询根文件夹中的文件?

(2) The code above returns the list of files in a folder. (2)上面的代码返回文件夹中的文件列表。
How can I get the list of folders within a folder? 如何获取文件夹中的文件夹列表? I there any parameter I can set to get this list? 我可以设置任何参数来获取此列表吗?
Note: I know that this is a 'flat' file system, similar to Amazon S3. 注意:我知道这是一个“平面”文件系统,类似于Amazon S3。 However, both (cloudfiles and S3) provides a way to work with 'folder'. 但是,这两个文件(cloudfiles和S3)都提供了使用“文件夹”的方法。 In S3 is easy. 在S3中很容易。 In cloudfiles (with the .net API) I could not find how to do this. 在cloudfiles中(使用.net API),我找不到如何执行此操作。

Any hint will be highly appreciated. 任何提示将不胜感激。

This has just been fixed with the latest push and closes issue #51 on github github上最新的推送和关闭问题#51已解决了这个问题

Link to downloadable package 链接到可下载的软件包

Hope this helps. 希望这可以帮助。

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

相关问题 如何删除所有文件/文件夹但将根文件夹保留在 C# 中 - How to delete all files/folders but keep the root folder in C# RackSpace CloudFiles如何使用异步或队列使用C#发送文件 - RackSpace CloudFiles how to use Asynchronous or Queue to send files using C# 如何列出特定文件夹内的文件夹和文件 - How to list folders and files inside a specific folder C#删除一个文件夹以及该文件夹内的所有文件和文件夹 - C# delete a folder and all files and folders within that folder CloudFiles-Rackspace连接错误C# - CloudFiles - Rackspace connection error c# Dropbox API C# 文件夹列表失败 - Dropbox API C# Folder List Fails 如何限制文件夹/子文件夹/文件仅访问程序? - How to limit folder/sub folders/files access to a program only? 使用C#API从启用Rackspace CloudFiles CDN的容器中检索图像 - Retrieve Image From Rackspace CloudFiles CDN-Enabled Container with C# API 如何通过C#中的WMI根据不同的扩展名查找C驱动器的文件和子文件夹中的文件路径列表 - How to find list of file path in files and in sub folders of C Drive based on different extension through WMI in C# c#目录文件,使用其各自的子文件夹和文件分别处理每个顶层文件夹 - c# Directories Files, process each top folder individually with its respective sub folders and files
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM