该文件正由另一个应用程序使用 [英] the File is being used by another application

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

问题描述

<大> 您好。

我想从.net运行一个外部应用程序,所以我写了它。

Hi.
I wanted to run an external application from .net so i wrote it .

Dim p As System.Diagnostics.Process =     System.Diagnostics.Process.Start(Address)
Thread.Sleep(55000)
If p.HasExited = False Then
    p.Kill()
End If



并且它实际上运作良好。但是当电力消失时,我的服务器将不会停止应用程序的实例

并且在启动之后服务器想要运行应用程序但是在这里它给了我错误。 该文件正由另一个应用程序使用

我试图用此代码关闭文件


and it worked well actually. But when the electricity goes off my server will not stop the instance of the application
and after starting up the server wants to run the application but here it gives me th error . "the file Is being Used by another application"
I tried to close the file with this code

If File.Exists(Address) Then
    File .Delete( AddressFile)
End If





但它再次给了我同样的错误

我该怎么办?



but it again gives me the same error
what should i do ?

推荐答案

Mate结束处理任务管理器中的文件。然后重新启动程序
Mate end process the file in the task manager. Then restart your program


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

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