【发布时间】:2015-03-02 17:39:48
【问题描述】:
我读过使用 Azure file 存储创建的文件和目录可以通过编程方式重命名,但找不到使用 .NET Microsoft.WindowsAzure.Storage 程序集(我正在使用v4.3.)。我知道 blob 不能重命名,但使用文件存储的文件应该可以。作为参考,我在下面包含了代码 sn-p。非常感谢任何帮助。
CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse("mycredentials");
CloudFileClient fileClient = cloudStorageAccount.CreateCloudFileClient();
CloudFileShare fileShare = fileClient.GetShareReference("myfileshare");
fileShare.CreateIfNotExists();
CloudFileDirectory rootDir = fileShare.GetRootDirectoryReference();
CloudFileDirectory directory = rootDir.GetDirectoryReference("mydirectory");
// The Name property of directory is read-only, and can't find a Rename method
【问题讨论】: