DeleteAsync错误:访问被拒绝。 (HRESULT异常:0x80070005(E

编程入门 行业动态 更新时间:2024-10-26 12:34:30
本文介绍了DeleteAsync错误:访问被拒绝。 (HRESULT异常:0x80070005(E_ACCESSDENIED))的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

问候,

我在WinRT C#工作。我有一个类下载10个7-Zip文件,解压缩然后尝试删除不再需要的原始文件。它删除较小的文件,但不删除较大的文件(只有一个兆左右),我甚至无法删除最后一个使用资源管理器尝试手动删除它,因为它说它仍在使用中。删除最后一个的唯一方法是关闭应用程序。代码很简单:

I am working in WinRT C#. I have a class that downloads 10 7-Zip files, decompresses them then tries to delete the original files that are no longer needed. It deletes the smaller files but does not delete the larger ones (only a meg or so) and I can't even delete the last one using Explorer trying to manually delete it because it says it's still in use. The only way to delete that last one is to close the app. The code is simple:

StorageFile file = await CreateOutputFile(fileName, path); MemoryStream theMemStream = new MemoryStream(); theMemStream.Write(bytes, 0, bytes.Length); await FileIO.WriteBytesAsync(file, bytes); var result = await unZipFile(file, path); try { if (file != null) { await file.DeleteAsync(); file = null; } } catch (Exception ex) { return ex.Message; }

推荐答案

我猜unZipFile中的某些运算符未完成导致此问题。

I guess some operator in unZipFile not are not finished caused this issue.

请检查unZipFile代码,在文件中存储或保存流。

Please check the unZipFile codes, to store or save stream in files.

最好的问候, Jesse

Best regards, Jesse

更多推荐

DeleteAsync错误:访问被拒绝。 (HRESULT异常:0x80070005(E

本文发布于:2023-11-06 01:45:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562407.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:被拒   异常   错误   DeleteAsync   HRESULT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!