Код: Выделить всё
Azure.RequestFailedException: 'The specified resource does not exist.
RequestId:0ccda3e3-d01a-00ae-42a5-21fad0000000
Time:2024-10-18T21:31:20.6046993Z
Status: 404 (The specified resource does not exist.)
ErrorCode: ResourceNotFound
Код: Выделить всё
public void DownloadALlFiles()
{
// Get a connection string to our Azure Storage account.
string connectionString = "connectionstring";
// Get a reference to a share named "sample-share"
ShareClient share = new ShareClient(connectionString, "clientshare");
// Get a reference to a directory named "sample-dir"
ShareDirectoryClient dir = share.GetDirectoryClient("directory/");
foreach (ShareFileItem item in dir.GetFilesAndDirectories())
{
Console.WriteLine(item.Name);
// Get a reference to a file named "sample-file" in directory "sample-dir"
ShareFileClient file = dir.GetFileClient(item.Name);
// Download the file
ShareFileDownloadInfo download = file.Download();
using (FileStream stream = File.Open("localpath"+ item.Name, FileMode.CreateNew))
{
download.Content.CopyTo(stream);
stream.FlushAsync();
stream.Close();
}
// await file.DeleteAsync();
}
//Console.ReadLine();
}
Я пытался использовать следующий код, чтобы пропустить каталог, но при этом также пропускаются файлы.
р>
Код: Выделить всё
if (item.IsDirectory)
{
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... tting-erro
Мобильная версия