我如何知道进程(即我的应用程序)当前打开了哪些文件?
我正在使用 Lucene.Net 索引,并希望为用户提供移动索引的选项,但在关闭索引以便移动目录/内容时遇到问题(我不断收到访问被拒绝的异常)。我需要能够获得更多信息,以便能够调试此问题,例如能够知道当前打开了哪些文件,以及有关每次使用的尽可能多的信息。
或者,有没有什么方法可以简单地强制关闭一堆文件以便移动它们?这将使事情更容易解决。
I am using a Lucene.Net index and want to give the user an option to move the index, but am having trouble closing it down so the directory/contents can be moved (I keep getting access denied exceptions). I need to be able to have some more information so I can debug this problem, such as being able to tell what files are currently open, and as much information about each use as possible.
Alternatively, is there any way to simply force close a bunch of files so they can be moved? This would make things a lot easier to solve.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 Process Explorer 找出哪个进程打开了文件。
You can use Process Explorer to find out which process has opened a file.