目录中的Azure访问blob

时间:2017-10-18 15:22:56

标签: azure blob

我试图下载容器中目录中的pdf blob:folder1 / test.pdf。

我已经尝试了以下但没有运气并搜索了示例,但无法找到任何内容。

 // Retrieve storage account from connection string.
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            CloudConfigurationManager.GetSetting("StorageConnectionString"));

        // Create the blob client.
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        // Retrieve reference to a previously created container.
        CloudBlobContainer container = blobClient.GetContainerReference("testcontainer/folder1");

        // Retrieve reference to a blob
        //CloudBlockBlob blockBlob2 = container.GetBlockBlobReference("test.pdf");

还试过这个:

 // Retrieve storage account from connection string.
        CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
            CloudConfigurationManager.GetSetting("StorageConnectionString"));

        // Create the blob client.
        CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

        // Retrieve reference to a previously created container.
        CloudBlobContainer container = blobClient.GetContainerReference("testcontainer");

        // Retrieve reference to a blob
        CloudBlockBlob blockBlob2 = container.GetBlockBlobReference("folder1/test.pdf");

提前感谢!

0 个答案:

没有答案