使用MemoryDll.au3嵌入dll使AutoIt脚本能直接压缩解压缩
首先到官方论坛下载爱好者编写的UDF:memorydll.au3 ,下载地址http://www.autoitscript.com/forum/index.php?showtopic=77463&hl=dll
然后到http://www.csdinc.co.jp/archiver/lib/7-zip32.html 下载7-Zip32.dll, 最新4.57.001版
运行MemoryDllGen.au3,选择把7-zip32.dll转成代码,并命名为 $Dll7zip32,粘贴到脚本中。然后使用函数_SevenZipCMD()来进行压缩解压缩,命令行参数可以查阅www.7-zip.org的官方文档。
#include "MemoryDll.au3"
Func _SevenZipCMD($sCMDLine, $hWnd = 0)
MemoryDllInit()
Local $sOutput
MemoryDllCall($Dll7zip32, "int", "SevenZip", "hwnd", $hWnd, "str", $sCMDLine, "str", $sOutput, "int", 0)
Local $error = @error
MemoryDllExit()
If $error Then
Return 0
Else
Return 1
EndIf
EndFunc ;==>_SevenZipCMD
01-04
2009