以下这段代码由 VBScript 转化过来的,使用方法很简单,将需要转换的文件拖一个到此脚本中即可!If $CmdLine[0] <> 1 Then Exit
$objStream = ObjCreate("ADODB.Stream")
$objStream.Type = 1
$objStream.Open
$objStream.LoadFromFile($CmdLine[1])
$objXMLDoc = ObjCreate("Msxml2.DOMDocument")
$objDocElem = $objXMLDoc.CreateElement("base64")
$objDocElem.dataType = "bin.base64"
$objDocElem.nodeTypedValue = $objStream.Read
$sBase64String = $objDocElem.text
$objStream.Close
MsgBox("",$CmdLine[1] & " BASE64 编码",$sBase64String)
;$objXMLDoc = ObjCreate("Msxml2.DOMDocument")
;$objDocElem = $objXMLDoc.CreateElement("base64")
;$objDocElem.dataType = "bin.base64"
$objDocElem.text = $sBase64String
$Base64Decode = $objDocElem.nodeTypedValue
;MsgBox("",$CmdLine[1] & " BASE64 解码",BinaryToString($Base64Decode))
MsgBox("",$CmdLine[1] & " BASE64 解码",$Base64Decode)
|