function Base64Encode(strData) dim objAds,objXd set objAds=createobject("adodb.stream") objAds.Type=2 objAds.charset="unicode" objAds.mode=3 call objAds.open() objAds.writeText strData objAds.Position=0 objAds.Type=1 'objAds.Position=2 set objXd=createobject("msxml.domdocument") call objXd.loadXml("<root/>") objXd.DocumentElement.DataType="bin.base64" objXd.DocumentElement.NodeTypedValue=objAds.read() Base64Encode=objXd.DocumentElement.text end function function Base64Decode(strData) dim objXd set objXd=createobject("msxml.domdocument") call objXd.loadXml("<root/>") objXd.DocumentElement.DataType="bin.base64" objXd.DocumentElement.text=strData Base64Decode=objXd.DocumentElement.NodeTypedValue end function
评论