我想列出子目录中的所有 blob,例如images/nature
在存储帐户中。我正在使用这个 c# 代码来实现我的目标:
string storageConnectionString = Environment.GetEnvironmentVariable("BlobConnection", EnvironmentVariableTarget.Process);
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(@"images/nature");
这段代码对我不起作用。你有什么想法,我该怎么做这份工作?
如果所有 blob 都在根文件夹中,则以下代码可以正常工作:
string storageConnectionString = Environment.GetEnvironmentVariable("BlobConnection", EnvironmentVariableTarget.Process);
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(storageConnectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference(@"images");