在论坛里找到了一段代码#Include <ACN_HASH.au3>
$Data = "C:\abc.exe"
MsgBox(0,"",_md5file($Data))
Func _md5file($File)
$Buffer = 0x20000
$FileH = FileOpen($File, 16)
$MD5C = _MD5Init()
For $i = 1 To Ceiling(FileGetSize($File) / $Buffer)
_MD5Input($MD5C, FileRead($FileH, $Buffer))
Next
FileClose($FileH)
Return StringTrimLeft (_MD5Result($MD5C), 2)
EndFunc
我改成了#Include <ACN_HASH.au3>
$Data= IniRead("lujin.ini","文件路径","路径","NotFound")
MsgBox(0,"",_md5file($Data))
Func _md5file($File)
$Buffer = 0x20000
$FileH = FileOpen($File, 16)
$MD5C = _MD5Init()
For $i = 1 To Ceiling(FileGetSize($File) / $Buffer)
_MD5Input($MD5C, FileRead($FileH, $Buffer))
Next
FileClose($FileH)
Return StringTrimLeft (_MD5Result($MD5C), 2)
EndFunc
lujin.ini :但是两个结果不一样,为什么呢? |