文件被另一个进程使用 [英] File is used by another process

查看:83
本文介绍了文件被另一个进程使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我输入的表单是ZIP文件.
然后,我使用ICSharpCode.SharpZipLib.dll解压缩并读取其中的一些Test.txt文件.

但是将其解压缩后,我尝试读取Test.txt,应用程序将引发错误"文件已被另一个进程使用"

这意味着在进行解压缩过程时,应用程序将尝试读取Test.txt文件.

我该怎么办?
如何等待文件成功解压缩.

我尝试使用Thread.Sleep()但失败了.

等待过程完成的任何帮助

-感谢advnace

My input to form is ZIP file.
Then I unzip it using ICSharpCode.SharpZipLib.dll and read some Test.txt file in it.

But after I Unzip it, I try to read Test.txt and the application throws the error "File is used by another process"

This means when unzip process is in progress the application is trying to read Test.txt file.

What should I do ?
How do I wait till file is successfully unzipped.

I tried with Thread.Sleep() but failed.

Any help to wait until process complete

- Thanks in advnace

推荐答案

不看代码就很难回答.但是,请尝试确保该过程已完成,并且SharpZipLib不保留对压缩文件的引用.
It is tough to answer without looking at the code. But try to make sure the process has completed and no references (to the zipped file) are held by the SharpZipLib.


这篇关于文件被另一个进程使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆