该进程无法访问该文件,因为另一个进程已锁定该文件的一部分。 57 [英] The process cannot access the file because another process has locked a portion of the file. 57

查看:118
本文介绍了该进程无法访问该文件,因为另一个进程已锁定该文件的一部分。 57的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨我突然收到加载文本文件的错误。

Hi I am suddenly getting this error loading a text file.

它一直有效,现在在我的主开发PC上它已经停止加载文件上面的错误

It has always worked and now on my main development PC it has stopped loading the file with the above error

Win 10完全更新。

Win 10 fully updated.

即使是最后一次胜利10更新之前编译的程序也会挂起。在其他Pc上它的确定和编译工作!!

Even the compiled program prior to last win 10 update hangs. On other Pc's its ok and compiled works !!

这是非常直接的代码

        DBst = ""
        FileOpen(2, FILEst, OpenMode.Input)
        Do While Not EOF(2)
            DBst = DBst + InputString(2, 1)
        Loop
100:    FileClose(2)


是否与One Drive有关,该程序是One Drive的一部分,但也无法在本地运行

Is it to do with One Drive, the program was on part of One Drive but also does not work locally

数据文件不在一个驱动器上。

The data files are not on One Drive.

实际数据已部分加载

奇数?

Steve

推荐答案

嗨Steve,

Hi Steve,

根据错误消息,此问题应该由您操作的文件由其他进程使用引起。请检查是否由其他进程读取或写入。例如,文件在文件资源管理器中打开,或者从
您的程序中读取其他进程。

According to the error message, this issue should be caused by the file that you operated is used by other process. Please check whether it is read or write by other process. For example, the file is opened in File Explorer or read by other process from your program.

您可以使用
句柄

Process Explorer
,以检查哪个进程首先使用您的数据文件。并且您需要检查程序中是否有其他代码读取文件而不是关闭读取过程,请参阅:

You could use Handle or Process Explorer to check which process uses your data file first. And you need to check whether there has other code in your program read the file but not close read process, please refer to:

https://social.msdn.microsoft.com/Forums/vstudio/en-US/f53b3ddf-0800-4aa4-93a9-9eba7c201679/the-process-cannot-access-the-file - 因为 - 另一个进程已经锁定了一部分文件?forum = vbgeneral

此外,由于此问题仅发生在您的主开发机器,请确保当前Windows用户具有管理员权限。并确保Visual Studio以管理员身份运行。

In addition, since this issue only occurs on your main development machine, please make sure current Windows user has administrator permission. And make sure the Visual Studio is running as administrator.

最好的问候,

Weiwei

Best Regards,
Weiwei


这篇关于该进程无法访问该文件,因为另一个进程已锁定该文件的一部分。 57的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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