您将如何以编程方式测试文件是否有病毒? [英] How would you programmatically test a file for viruses?

查看:26
本文介绍了您将如何以编程方式测试文件是否有病毒?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想以编程方式测试文件是否有病毒.

I want to programmatically test a file for viruses.

我知道 this thread,在我看来没有得到满意的答案,但我不是在这里寻找 API.任何可以测试文件的解决方法都可以.

I'm aware of this thread, which didn't get a satisfactory answer in my opinion, but I'm not looking for an API here. Any kind of workaround to make it possible to test a file would be fine.

当然,API 可能是最好的解决方案(我在 Windows 平台上使用 .net),但也许可以将文件放入文件夹中,然后检查我是否仍然可以打开它或如果它被杀毒软件隔离了.

Of course, an API would probably be the best solution (I'm using .net on a Windows platform), but maybe it's possible to drop the file in the folder, and to then check whether I can still open it or if it's been quarantined by the antivirus software.

有人遇到过同样的情况吗?

Has someone run into the same sort of situation?

推荐答案

假设您希望与系统上已经存在的任何防病毒软件集成而不是捆绑您自己的防病毒软件,您应该查看 Firefox 3 这样做的方式.

Assuming you wish to integrate with whatever antivirus is already present on the system rather than bundling your own, you should check out the way Firefox 3 does this.

><块引用>

错误 103487和 408153- 当 Firefox 下载可执行文件时通知防病毒软件(使用Windows "IOfficeAntiVirus" 和IAttachmentExecute"API).

Bugs 103487 and 408153 - Inform anti-virus software when Firefox downloads an executable (using the Windows "IOfficeAntiVirus" and "IAttachmentExecute" APIs).

(当然,如果您想捆绑自己的,请查看 ClamAV/ClamWin,但随后您必须处理更新等问题,为了礼貌起见,您可能应该首先检查目标系统上是否没有完全更新的解决方案)

(of course if you wish to bundle your own, check out ClamAV/ClamWin, but then you must deal with updates, etc, and you should probably first check there is not a fully updated solution on the target system for politeness)

这篇关于您将如何以编程方式测试文件是否有病毒?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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