是否有可能获取文件的路径,并尝试访问另一个文件? [英] Is this possible to get path of file, which try access to another file?

查看:62
本文介绍了是否有可能获取文件的路径,并尝试访问另一个文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

FileSystemWatcher检测访问文件的事实.

FileSystemWatcher detects a fact of access to the file. Is there a way to get which file was modified and what file has done it?

推荐答案

当它检测到文件已更改时,可以从文件中检索该文件名.事件方法参数.

我非常确定,不可能(通过标准FileSystemWatcher对象)检测哪个文件正在对给定文件执行操作.您可能需要为此编写(很多)代码.


When it detects that a file has changed, you can retrieve that filename from the event methed arguments.

I am pretty sure that it''s impossible (through the standard FileSystemWatcher object) to detect which file is performing an action on a given file. You would probably have to write (a lot of) code for that.



是的,事件参数将告诉您哪个文件被修改了.事件类型将告诉您完成了什么类型的操作.

有什么可以告诉您该操作对文件做了什么?否.无法确切知道文件中更改的内容.

有什么可以告诉您哪个进程更改了文件?不,不是.
Yeah, the event arguments will tell you which file was modified. The event type will tell you what type of operation was done.

Is there anything that will tell you what that operation did to the file?? No. There''s no way to know exactly what was changed in the file.

Is there anything that will tell you which process changed the file?? No, there''s isn''t.


这篇关于是否有可能获取文件的路径,并尝试访问另一个文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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