asp base64编码中文
来源:未知 责任编辑:责任编辑 发表时间:2013-11-18 20:55 点击:次
在网上找了很久,终于找到一个可以用的!
<%
Function base64Encode(sString)
If sString = "" or IsNull(sString) Then
base64Encode = ""
Exit Function
End If
Dim xml_dom, Node
Set xml_dom = CreateObject("Microsoft.XMLDOM")
With xml_dom
.loadXML ("<?xml version='1.0' ?> <root/>")
Set Node = xml_dom.createElement("MyText")
With Node
.dataType = "bin.base64"
.nodeTypedValue = Gb2312_Stream(sString)
base64Encode = .Text
End With
xml_dom.documentElement.appendChild Node
End With
Set xml_dom = Nothing
End Function
Function base64uncode(sString)
If sString = "" or IsNull(sString) Then
base64uncode = ""
Exit Function
End If
Dim xml_dom, Node
Set xml_dom = CreateObject("Microsoft.XMLDOM")
With xml_dom
.loadXML ("<?xml version='1.0' ?> <root/>")
Set Node = xml_dom.createElement("MyText")
With Node
.dataType = "bin.base64"
.Text = sString
base64uncode = Stream_GB2312(.nodeTypedValue)
End With
xml_dom.documentElement.appendChild Node
<%
Function base64Encode(sString)
If sString = "" or IsNull(sString) Then
base64Encode = ""
Exit Function
End If
Dim xml_dom, Node
Set xml_dom = CreateObject("Microsoft.XMLDOM")
With xml_dom
.loadXML ("<?xml version='1.0' ?> <root/>")
Set Node = xml_dom.createElement("MyText")
With Node
.dataType = "bin.base64"
.nodeTypedValue = Gb2312_Stream(sString)
base64Encode = .Text
End With
xml_dom.documentElement.appendChild Node
End With
Set xml_dom = Nothing
End Function
Function base64uncode(sString)
If sString = "" or IsNull(sString) Then
base64uncode = ""
Exit Function
End If
Dim xml_dom, Node
Set xml_dom = CreateObject("Microsoft.XMLDOM")
With xml_dom
.loadXML ("<?xml version='1.0' ?> <root/>")
Set Node = xml_dom.createElement("MyText")
With Node
.dataType = "bin.base64"
.Text = sString
base64uncode = Stream_GB2312(.nodeTypedValue)
End With
xml_dom.documentElement.appendChild Node
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>