Delphiを使用してプログラムでウイルス対策プログラムを実行してください
-
18-09-2020 - |
質問
私はインディーコンポーネントを使用してファイルを転送するための小さなアプリを書きました、今度は転送が終了したときにアンチウイルスプログラムを起動したい場合はファイルを確認してください。
ダウンロード終了時にクライアント側にインストールされているアンチウイルスプログラムを実行する方法は?
アップデート ファイルをダウンロードしてから、マシンにインストールされているアンチウイルスを実行すると、Firefoxに似たものを実装する必要があります。
事前にありがとうございました。
解決
あなたが掴んでいるべき2つのcomインターフェースがあるように見えます、そのうちの1つはここに文書化されています:
このインタフェースは、Windowsシェルインタフェースの一部です。
の解説です。/**
* 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.
.
他のヒント
WinRarのように、その他のプログラムをどのようにして確認してください。ほとんどの場合、コマンドラインパラメータとしてスキャンするファイルまたはフォルダを使用してウイルス対策プログラムを開始するだけです。アンチウイルスプログラムのマニュアルを確認して、それがどのようにして行われるかを確認できます。
ShellExecuteまたはCreateProcessを使用できます。 ShellExecuteを使用していますが、CreateProcessがより良いことを聞いたことがあります Shellapiを使用してAntivvvと呼ばれるアンチウイルスを実行したい場合は、次のようにしてください。
uses ShellApi;
...
ShellExecute(Handle, 'open', 'c:\program files\antivvv.exe', nil, nil, SW_SHOWNORMAL) ;
. 所属していません StackOverflow