下载电子邮件附件时使用Microsoft Security Essentials的在C# [英] Use Microsoft Security Essentials in C# when downloading email attachment

查看:168
本文介绍了下载电子邮件附件时使用Microsoft Security Essentials的在C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我做一个简单的程序来获得使用VS2010 POP3服务器的电子邮件。
可能要去使用开源OpenPOP了一些。
和它应该然后保存电子邮件和附件中的MS SQL数据库。



但问题是,当附加文件很容易从邮件服务器上下载,有没有什么办法来扫描附加的文件?
中的小公司在即时通讯工作只使用微软的安全要领。



大约有一派,却似乎无法找到关于此事的任何信息。


解决方案

您可以使用:



<预类=郎无prettyprint,覆盖> 为%ProgramFiles%\Microsoft安全Client\MpCmdRun.exe - 扫描-ScanType 3 - 文件<路径>中

和检查返回代码。



其他信息:



<预类=郎无prettyprint-覆盖> - 扫描[-ScanType值]
0默认值,根据配置
1快速扫描
2全系统扫描
3文件和目录自定义扫描

[ - 文件<路径>]
指示文件或目录进行扫描,仅适用于
定义扫描。

[-DisableRemediation]
此选项仅适用于自定义扫描是有效的。
在指定:
- 文件排除被忽略。
- 归档文件进行扫描。
- 动作检测后不被应用。
- 事件日志条目的检测之后将不写入。
- 从自定义扫描检测在用户
界面不显示。

返回码为
0,如果没有恶意软件被发现或恶意软件被成功修复,并没有
附加用户操作需要
2,如果恶意软件被发现,将不修复或额外的用户操作即可完成整治或出现错误扫描所需

请有关详细信息,查看历史记录。


I'm making a simple program to get emails from a pop3 server using VS2010. probably gonna use the open source OpenPOP for some of it. And its supposed to then save the email and attachments in a MS SQL database.

But the question is, while attached files are easy to download from the mail server, is there any way to scan the attached files? The small company im working at uses just Microsoft security essentials.

Have googled around, but couldn't seem to find any info on this matter.

解决方案

You can use:

"%ProgramFiles%\Microsoft Security Client\MpCmdRun.exe" -Scan -ScanType 3 -File "<Path>"

and check the return code.

Additional information:

-Scan [-ScanType value]
     0  Default, according to your configuration
     1  Quick scan
     2  Full system scan
     3  File and directory custom scan

        [-File <path>]
             Indicates the file or directory  to be scanned, only valid for
             custom scan.

        [-DisableRemediation]
             This option is valid only for custom scan.
             When specified:
               - File exclusions are ignored.
               - Archive files are scanned.
               - Actions are not applied after detection.
               - Event log entries are not written after detection.
               - Detections from the custom scan are not displayed in the user
                 interface.

   Return code is
   0    if no malware is found or malware is successfully remediated and no
        additional user action is required
   2    if malware is found and not remediated or additional user action is
        required to complete remediation or there is error in scanning.
        Please check History for more information.

这篇关于下载电子邮件附件时使用Microsoft Security Essentials的在C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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