Windows文件资源管理器如何自动刷新自己?

时间:2023-01-18 16:58:35

Does it run in a loop polling the contents? (Highly unlikely and inefficient.)

它是否在循环中轮询内容? (非常不可能和效率低下。)

Or is it done with some event trigger?

或者它是通过一些事件触发完成的?

In fact, what I am really wondering is how does Windows Explorer refresh itself when it shows the contents of another computer over a network?

事实上,我真正想知道的是,当它通过网络显示另一台计算机的内容时,Windows资源管理器如何刷新自己?

How does the computer (or the OS) with the content notify the computer with the Explorer that its content has changed? If there is a mechanism to notify, what is the protocol? RPC?

具有内容的计算机(或OS)如何通过资源管理器通知计算机其内容已更改?如果有机制通知,协议是什么? RPC?

2 个解决方案

#1


See this previous question:

看到上一个问题:

How does FileSystemWatcher work on another computers directory?

FileSystemWatcher如何在另一个计算机目录上工作?

It appears to be based on the ReadDirectoryChangesW API function.

它似乎基于ReadDirectoryChangesW API函数。

Edit: There is a Microsoft article detailing another way to do it, but the documentation for the specific functions imply that it might not work on a remote computer.

编辑:有一篇Microsoft文章详细说明了另一种方法,但特定功能的文档暗示它可能无法在远程计算机上运行。

#2


Is this just out of curiosity or are you looking to do the same type of thing for your application?

这只是出于好奇还是你想为你的应用程序做同样的事情?

If you just need to be notified of changes to folders in normal user scenarios consider SHChangeNotifyRegister. if you're just curious or need a lower level hook, nevermind. :)

如果您只需要在正常用户方案中收到有关文件夹更改的通知,请考虑SHChangeNotifyRegister。如果你只是好奇或需要一个较低级别的钩子,没关系。 :)

#1


See this previous question:

看到上一个问题:

How does FileSystemWatcher work on another computers directory?

FileSystemWatcher如何在另一个计算机目录上工作?

It appears to be based on the ReadDirectoryChangesW API function.

它似乎基于ReadDirectoryChangesW API函数。

Edit: There is a Microsoft article detailing another way to do it, but the documentation for the specific functions imply that it might not work on a remote computer.

编辑:有一篇Microsoft文章详细说明了另一种方法,但特定功能的文档暗示它可能无法在远程计算机上运行。

#2


Is this just out of curiosity or are you looking to do the same type of thing for your application?

这只是出于好奇还是你想为你的应用程序做同样的事情?

If you just need to be notified of changes to folders in normal user scenarios consider SHChangeNotifyRegister. if you're just curious or need a lower level hook, nevermind. :)

如果您只需要在正常用户方案中收到有关文件夹更改的通知,请考虑SHChangeNotifyRegister。如果你只是好奇或需要一个较低级别的钩子,没关系。 :)