用VBS实现PHP的md5_file函数代码_vbs教程-查字典教程网
用VBS实现PHP的md5_file函数代码
用VBS实现PHP的md5_file函数代码
发布时间:2016-12-28 来源:查字典编辑
摘要:复制代码代码如下:Functionmd5_file(filename,raw_output)DimHashedData,Utility,St...

复制代码 代码如下:

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

相关阅读
推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
  • 大家都在看
  • 小编推荐
  • 猜你喜欢
  • 最新vbs学习
    热门vbs学习
    脚本专栏子分类