C#中如何检测任何文件被附加/上传到电子邮件客户端或电子邮件在Web浏览器中? [英] How to detect when any file is being attached/uploaded to an email client or email in web browser in C#?

查看:147
本文介绍了C#中如何检测任何文件被附加/上传到电子邮件客户端或电子邮件在Web浏览器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当任何文件在浏览器或任何电子邮件客户端附加到电子邮件时,如何检测事件?当文件被附加时,在Windows或浏览器中运行的进程是什么?换句话说,上传文件的过程是什么?如何从c#代码中检测出这个进程?有没有办法使用FileSystemWatcher检测这个事件或进程?

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?

推荐答案

简单来说,没有。所有上载文件都是打开的,所以理论上可以做的最好的是找到打开文件并使用启发式的过程。但是FileSystemWatcher用于监视对文件的更改,最接近查找打开文件的进程将不断地使用C#中的外部工具handle.exe或C ++中的NtQuerySystemInformation来轮询它的状态。

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

这篇关于C#中如何检测任何文件被附加/上传到电子邮件客户端或电子邮件在Web浏览器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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