用VBS实现PHP的md5_file函数代码
更新时间:2011年01月21日 22:43:29 作者:
用VBS实现PHP的md5_file函数代码,需要的朋友可以参考下,代码主要是参考官方的资料。
复制代码 代码如下:
Function md5_file(filename, raw_output)
Dim HashedData, Utility, Stream
Set HashedData = CreateObject("CAPICOM.HashedData")
Set Utility = CreateObject("CAPICOM.Utilities")
Set Stream = CreateObject("ADODB.Stream")
HashedData.Algorithm = 3
Stream.Type = 1
Stream.Open
Stream.LoadFromFile filename
Do Until Stream.EOS
HashedData.Hash Stream.Read(1024)
Loop
If raw_output Then
md5_file = Utility.HexToBinary(HashedData.Value)
Else
md5_file = HashedData.Value
End If
End Function
参考链接:HashedData Object
原文:http://demon.tw/programming/vbs-php-md5_file.html
相关文章
让IIS建立的站点默认是.net 2.0的,而不是.net 1.1的代码
让IIS建立的站点默认是.net 2.0的,而不是.net 1.1的,没有使用WMI,所以在操作前先得停止IIS相关服务2008-07-07


最新评论