使用delphi以编程方式执行防病毒程序

发布于 2024-09-10 08:14:04 字数 174 浏览 4 评论 0原文

我编写了一个小应用程序来使用 indy 组件传输文件,现在我想在传输完成后启动防病毒程序来检查文件。

下载完成后,如何执行客户端安装的防病毒程序?

更新 下载文件时我需要实现类似于 Firefox 的功能,然后执行机器中安装的防病毒软件。

提前致谢。

I wrote an small app to transfer files using the indy components, now i want start the antivirus program when the transfer is finished to check the files.

how i can execute the antivirus program installed in the client side, when the download finish?

UPDATE
I need implement something similar to firefox when download a file and then execute the antivirus installed in the machine.

thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

嘴硬脾气大 2024-09-17 08:14:05

请参阅好人对我的其他问题的回答。

看起来您应该抓住两个 COM 接口,其中一个记录在此处:

IAttachmentExecute

此接口是 Windows shell 接口的一部分。

这是源中的评论

/**
 * Code overview
 *
 * Download scanner attempts to make use of one of two different virus
 * scanning interfaces available on Windows - IOfficeAntiVirus (Windows
 * 95/NT 4 and IE 5) and IAttachmentExecute (XPSP2 and up).  The latter
 * interface supports calling IOfficeAntiVirus internally, while also
 * adding support for XPSP2+ ADS forks which define security related
 * prompting on downloaded content.  
 *
 * Both interfaces are synchronous and can take a while, so it is not a
 * good idea to call either from the main thread. Some antivirus scanners can
 * take a long time to scan or the call might block while the scanner shows
 * its UI so if the user were to download many files that finished around the
 * same time, they would have to wait a while if the scanning were done on
 * exactly one other thread. Since the overhead of creating a thread is
 * relatively small compared to the time it takes to download a file and scan
 * it, a new thread is spawned for each download that is to be scanned. Since
 * most of the mozilla codebase is not threadsafe, all the information needed
 * for the scanner is gathered in the main thread in nsDownloadScanner::Scan::Start.
 * The only function of nsDownloadScanner::Scan which is invoked on another
 * thread is DoScan.

我在这里找到了更多实现信息。该功能称为 AES。

See the nice person's answer to my other question.

Looks like there are two COM interfaces you should be grabbing, one of which is documented here:

IAttachmentExecute

This interface is part of the windows shell interfaces.

here is the commentary in the source

/**
 * Code overview
 *
 * Download scanner attempts to make use of one of two different virus
 * scanning interfaces available on Windows - IOfficeAntiVirus (Windows
 * 95/NT 4 and IE 5) and IAttachmentExecute (XPSP2 and up).  The latter
 * interface supports calling IOfficeAntiVirus internally, while also
 * adding support for XPSP2+ ADS forks which define security related
 * prompting on downloaded content.  
 *
 * Both interfaces are synchronous and can take a while, so it is not a
 * good idea to call either from the main thread. Some antivirus scanners can
 * take a long time to scan or the call might block while the scanner shows
 * its UI so if the user were to download many files that finished around the
 * same time, they would have to wait a while if the scanning were done on
 * exactly one other thread. Since the overhead of creating a thread is
 * relatively small compared to the time it takes to download a file and scan
 * it, a new thread is spawned for each download that is to be scanned. Since
 * most of the mozilla codebase is not threadsafe, all the information needed
 * for the scanner is gathered in the main thread in nsDownloadScanner::Scan::Start.
 * The only function of nsDownloadScanner::Scan which is invoked on another
 * thread is DoScan.

I found some more implementation information here. The feature is called AES.

满栀 2024-09-17 08:14:05

检查其他程序如何执行此操作,例如 Winrar。最有可能的是,它只是使用您要扫描的文件或文件夹作为命令行参数来启动防病毒程序。您可以查看防病毒程序的手册来了解它是如何完成的。

Check how other programs do it, like Winrar. Most likely it is just starting the anti-virus program with the file or folder you want to scan as a command-line parameter. You can check the manual of your anti-virus program to check how it's done.

我们的影子 2024-09-17 08:14:05

您可以使用 shellexecute 或 createprocess,
我使用 shellexecute 但我听说 createprocess 更好
如果您想使用 shellapi 执行名为 antivvv 的防病毒软件,请按以下方式操作:

uses ShellApi;
 ...
 ShellExecute(Handle, 'open', 'c:\program files\antivvv.exe', nil, nil, SW_SHOWNORMAL) ; 

you can use shellexecute or createprocess,
i use shellexecute but i've heard createprocess is better
if you want to execute an antivirus called say antivvv using shellapi do it this way:

uses ShellApi;
 ...
 ShellExecute(Handle, 'open', 'c:\program files\antivvv.exe', nil, nil, SW_SHOWNORMAL) ; 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文