【发布时间】:2017-07-12 04:42:33
【问题描述】:
我想创建文件夹和子文件夹,我找到了this workaround: 但是当我列出它们时:使用此代码(source):
foreach (IListBlobItem item in Container.ListBlobs(null, false))
{
if (item.GetType() == typeof(CloudBlockBlob))
{
CloudBlockBlob blob = (CloudBlockBlob)item;
Console.WriteLine("Block blob of length {0}: {1}", blob.Properties.Length, blob.Uri);
}
else if (item.GetType() == typeof(CloudPageBlob))
{
CloudPageBlob pageBlob = (CloudPageBlob)item;
Console.WriteLine("Page blob of length {0}: {1}", pageBlob.Properties.Length, pageBlob.Uri);
}
else if (item.GetType() == typeof(CloudBlobDirectory))
{
CloudBlobDirectory directory = (CloudBlobDirectory)item;
Console.WriteLine("Directory: {0}", directory.Uri);
}
}
它只显示根容器中的父文件夹和 blob。 我期待将它们全部作为 blob 获取,因为这是虚拟目录而不是真实的, 例如我有这个文件
https://account.blob.core.windows.net/container/Accounts/Images/1/acc.jpg
但它不显示,它只是显示:
https://account.blob.core.windows.net/container/Accounts
和
https://account.blob.core.windows.net/container/anyfile
我是否必须请求父文件夹中的子文件夹才能访问该文件?
【问题讨论】:
标签: azure azure-storage azure-blob-storage