我是靠谱客的博主 爱听歌芒果,最近开发中收集的这篇文章主要介绍Asp读取xml存储的图片Base64编码,还原成图片,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

base.xml代码
<?xml version="1.0" encoding="gb2312"?>
<data>
<![CDATA[iVBORw0KGgoAAAANSUhEUgAAAQ4AAAEsCAYAAAAy1V2YAAAJCElEQVR42u3dDYobORAG0Nwpd8qdcqfcaReziBRFSSp192SD/R6YhFnPxLNYn6XS37dvAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAME//FW8IxEcCA4EB4IDBIfgAMEhOEBwCA4QHAgOBAeCA8GB4ADBIThAcAgOEBwIDgQHggPBgeAAwSE4QHAIDhAcCA4EB4IDwYHgAMEhOEBwCA4QHP+3X796z/v58/dDcCA4mo3r1WB+/Pjd0F5/xkf1/Nej0zDzz3rqsQuC1+/TeY2v//567ut/n+BAcBwEx/fv/z1GwxmNKX5t1tBWDTP+7Nfz899XX1s9p3pdOTg6zxtmv6vgQHBsGlnucYzGVPU4uo0yPnf8G3cfIzxW//boFXV7EYIDwXHY26gazSo4YtBc/fl3ahaz13VnuCI4EByHvY3Xt8Xexq7Bx+95Ijh2NYv8uk56O516yGnvRHDw0cERG0wOgdkne6xvjLCJMxL5031WPzkZ+owezvj5sx5S7AnNHnlIFnscsX5SPbozNIKDtw6O0dByCIwGlmsTIxRGIxuPWLTc9VxiCFSFzKpx5qCqnlu9rtmj+nc6wXGhN+IdyfsFR2xo+dM8z2DE8Ih/r8JnNVSpCrGxJxDrEtX372Z7rkzlGqogOA5rGzE4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OBAcIDgEBwAAAAAAAAAAAAAAAAAAAADAo/4F6+HmEPy+t9QAAAAASUVORK5CYII=]]>
</data>


把以下代码保存为base.asp

<%
Dim xml : Set xml=Server.CreateObject("MSXML2.DOMDocument")
Dim stm : Set stm=Server.CreateObject("ADODB.Stream")
xml.resolveExternals=False
xml.load Server.MapPath("base.xml")
xml.documentElement.setAttribute "xmlns:dt","urn:schemas-microsoft-com:datatypes"
xml.documentElement.dataType = "bin.base64"
stm.Type=1 'adTypeBinary
stm.Open
stm.Write xml.documentElement.nodeTypedValue
stm.SaveToFile Server.MapPath("12.png")
stm.Close
Set xml=Nothing
Set stm=Nothing
%>


 

最后

以上就是爱听歌芒果为你收集整理的Asp读取xml存储的图片Base64编码,还原成图片的全部内容,希望文章能够帮你解决Asp读取xml存储的图片Base64编码,还原成图片所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(50)

评论列表共有 0 条评论

立即
投稿
返回
顶部