excel vba base64 ทำการเข้ารหัสถอดรหัสข้อความ
'VBA functions to encode and decode Base64 text.
'Both support utf-8:
Function EncodeBase64(text$)
Dim b
With CreateObject("ADODB.Stream")
.Open: .Type = 2: .Charset = "utf-8"
.WriteText text: .Position = 0: .Type = 1: b = .Read
With CreateObject("Microsoft.XMLDOM").createElement("b64")
.DataType = "bin.base64": .nodeTypedValue = b
EncodeBase64 = Replace(Mid(.text, 5), vbLf, "")
End With
.Close
End With
End Function
Function DecodeBase64(b64$)
Dim b
With CreateObject("Microsoft.XMLDOM").createElement("b64")
.DataType = "bin.base64": .text = b64
b = .nodeTypedValue
With CreateObject("ADODB.Stream")
.Open: .Type = 1: .Write b: .Position = 0: .Type = 2: .Charset = "utf-8"
DecodeBase64 = .ReadText
.Close
End With
End With
End Function
xml
Extensible Markup Language (XML) is a markup language that defines a set of
rules for encoding documents in a format that is both human-readable and
machine-readable. The World Wide Web Consortium's XML 1.0 Specification of 1998
and several other related specifications—all of them free open standards—define
XML.
xml
<?xml version="1.0">
<page>
<link href="styles.css" rel="stylesheet"/>
<date/>
</page>
XML
Extensible Markup Language (XML)
xml
<paramater>value</paramater>
<paramater>
test
</paramater>