' Base64 编码函数 Function BASE64ENCODE(strText As String) As String Dim arrData() As Byte arrData = StrConv(strText, vbFromUnicode) Dim objXML As Object Dim objNode As Object Set objXML = CreateObject("MSXML2.DOMDocument.6.0") Set objNode = objXML.createElement("b64") objNode.DataType = "bin.base64" objNode.nodeTypedValue = arrData BASE64ENCODE = objNode.Text End Function ' Base64 解码函数 Function BASE64DECODE(strBase64 As String) As String Dim objXML As Object Dim objNode As Object Set objXML = CreateObject("MSXML2.DOMDocument.6.0") Set objNode = objXML.createElement("b64") objNode.DataType = "bin.base64" objNode.Text = strBase64 BASE64DECODE = StrConv(objNode.nodeTypedValue, vbUnicode) End Function