我有这个 c# 代码,我想删除文档库中的某个子目录。但是,这会产生错误,因为目录不为空。我希望有人可以指导我如何做到这一点。
感谢您的及时回复。
StorageFolder storageFolder = KnownFolders.DocumentsLibrary;
var queryResult = storageFolder.CreateFolderQuery();
IReadOnlyList<StorageFolder> folderList = await queryResult.GetFoldersAsync();
foreach (StorageFolder folder in folderList)
{
await folder.DeleteAsync();
}