简体   繁体   中英

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

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?

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++.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM