1
我读过使用Azure创建的文件和目录文件存储可以以编程方式重命名,但无法找到使用文件.NET Microsoft.WindowsAzure.Storage程序集(我正在使用v4.3)。我知道blob不能重命名,但使用文件存储的文件应该可以。作为参考,我将包含下面的代码片段。任何帮助不胜感激。以编程方式(.NET)重命名使用文件(而非Blob)存储的Azure文件或目录
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
谢谢。这样做的问题之一是使用文件存储重命名目录时的开销量;我需要删除并重新创建被重命名的目录层次结构中的每个文件和目录,这可能是许多文件和子目录。似乎有些荒谬的是,到目前为止,Azure还没有想出一种有效的方法。 – gridlock 2015-03-02 20:16:16