该进程无法访问文件'\\ server \ share',因为它正被另一个进程使用。 [英] The process cannot access the file '\\server\share' because it is being used by another process.

查看:303
本文介绍了该进程无法访问文件'\\ server \ share',因为它正被另一个进程使用。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在保存一个文件后完成了远程驱动器上的文件保存我试图保存另一个文件并且它会抛出错误 - >该进程无法访问文件'\\ server\ share',因为它正由另一个进程使用。请为此问题提出解决方案

i accomplished file saving on Remote drive after saving one file i tried to save another file and it throws error as --> The process cannot access the file '\\server\share' because it is being used by another process.Please suggest solution for this issue

推荐答案

这意味着您用于文件操作的资源尚未处理。

在您的代码中,在每次文件操作后,尝试处理该对象。



但现在你必须去那个驱动器并检查任务管理器。找到正在运行的进程。

关闭或结束该进程,然后执行代码,它应该可以工作。确保在代码中处理File对象。
That means the resources which you have used for File operation has not yet been disposed.
In your code, after each file operation, try to dispose the object.

But now you have to go that drive and check the Task Manager. Locate your process which is running.
Close that or End that process and then execute your code, it should work. Make sure that you are disposing the File objects in your code.


已解决。实际上我添加新文件的网络路径保存在If Exists目录中。



感谢您的帮助!
Resolved . Actually the network path to which im adding new file is kept in If Exists Directory.

Thanks for the help!


这篇关于该进程无法访问文件'\\ server \ share',因为它正被另一个进程使用。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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