ASP经典 - 使用Base64Binary字符串转换为字节数组 [英] ASP Classic - convert base64binary string to byte array
问题描述
我想一个使用Base64Binary字符串转换为传统的ASP的字节数组。中StrConv()不存在ASP。
I am trying to convert a base64binary string to a byte array in classic ASP. StrConv() doesn't exist in ASP.
我的目标是把从Web服务调用收到的使用Base64Binary字符串,并写入二进制格式的文件。
My objective is to take the base64binary string received from a web service call, and write the binary format to a file.
感谢,
-m
thanks,
-m
推荐答案
在前段时间面临着类似的情况,我用的 MSXML 的保存到文件之前将数据转换为字节数组。您将需要3或更高版本。
When faced with a similar situation some time ago, I used MSXML to convert the data to a byte array before saving it to a file. You will need version 3 or higher.
要做到这一点,你会:
- 与MSXML加载数据
- 设置节点的
的dataType
属性bin.base64
- 使用的
nodeTypedValue
财产 - 要救你可以使用 ADODB文件。流组件。
- Load the data with MSXML
- Set the node's
dataType
property tobin.base64
- Read the binary data from the node using the
nodeTypedValue
property - To save the file you can use the ADODB.Stream component.
这是怎么这个都低于几个环节。
A few links on how the to this are below.
的http://ghads.word$p$pss.com/2008/10/17/vbscript-readwrite-binary-en$c$cde$c$c-base64/
http://support.microsoft.com/kb/254388
http://www.motobit.com/tips/detpg_binasp/
这篇关于ASP经典 - 使用Base64Binary字符串转换为字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!