How to detect when any file is being attached/uploaded to an email client or email in web browser in C#?

心不动则不痛 提交于 2019-12-25 03:55:21

问题


When any file is attached to email in browser or any email client, how to detect the event? What is the process running in windows or browser when the file is being attached? In other words what is the process for uploading of files? How to detect that process from c# code? Is there any way to detect this event or process using FileSystemWatcher?


回答1:


Simply speaking, there is not. All uploading a file does is open it,so the best you could do in theory is find the process that was opening the file and use heuristics. However FileSystemWatcher is for monitoring changes to files, and the closest you could get to finding out which process was opening a file would be constantly polling it's status using the external tool handle.exe in C#, or NtQuerySystemInformation in C++.



来源:https://stackoverflow.com/questions/24968932/how-to-detect-when-any-file-is-being-attached-uploaded-to-an-email-client-or-ema

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!