我編寫了一個使用indy組件傳輸文件的小應用程序,現在我希望在傳輸完成後檢查文件時啓動防病毒程序。使用delphi以編程方式執行防病毒程序
當下載完成時,我可以執行安裝在客戶端的防病毒程序嗎?
UPDATE 我需要在下載文件時執行類似於firefox的東西,然後執行安裝在機器上的防病毒軟件。
在此先感謝。
我編寫了一個使用indy組件傳輸文件的小應用程序,現在我希望在傳輸完成後檢查文件時啓動防病毒程序。使用delphi以編程方式執行防病毒程序
當下載完成時,我可以執行安裝在客戶端的防病毒程序嗎?
UPDATE 我需要在下載文件時執行類似於firefox的東西,然後執行安裝在機器上的防病毒軟件。
在此先感謝。
See the nice person's answer to my other question.
看起來像有你應該抓住其中一個在這裏是個COM接口,:
此接口是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.
I found some more implementation information here. The feature is called AES.
顯示Firefox如何執行它的C++源代碼位於http://mxr.mozilla.org/mozilla1.9.1/source/toolkit/components/downloads/src/nsDownloadScanner.cpp – glob 2010-07-21 02:21:03
檢查其他程序如何執行它,如Winrar。最有可能的是,只需將要掃描的文件或文件夾作爲命令行參數啓動防病毒程序即可。你可以查看你的防病毒程序的手冊來檢查它是如何完成的。
可以使用的ShellExecute或CreateProcess的, 我使用的ShellExecute但我聽說CreateProcess的是更好 如果要執行所謂的防病毒說antivvv用做ShellAPI的是這樣:
uses ShellApi;
...
ShellExecute(Handle, 'open', 'c:\program files\antivvv.exe', nil, nil, SW_SHOWNORMAL) ;
爲什麼這會降低投票率? – 2010-07-20 17:03:47
我不是那個人,但可能是因爲它沒有做任何事情來讓AV檢查一個文件。 – 2010-07-20 17:22:30
這隻取決於防病毒程序的命令行選項。 -1似乎苛刻。 – Tobiasopdenbrouw 2010-07-20 20:23:22
評不大多數防病毒程序掛接到文件系統,反正檢測新文件? – 2010-07-20 16:57:08
您是否問如何讓應用程序在其他用戶的計算機上自動啓動(不是您自己的)?你想提供服務嗎?你寫了一個反病毒程序,或者你想讓反病毒程序掃描你的程序不是反病毒程序?我很困惑。 – 2010-07-20 20:23:11
@Warren P,我更新了我的問題。只需要我的客戶端應用程序完成下載時使用安裝的防病毒掃描文件。 – Salvador 2010-07-20 20:31:15