ASP Classic - 将 base64binary 字符串转换为字节数组 [英] ASP Classic - convert base64binary string to byte array
问题描述
我正在尝试将 base64binary 字符串转换为经典 ASP 中的字节数组.StrConv() 在 ASP 中不存在.
我的目标是获取从 Web 服务调用接收到的 base64binary 字符串,并将二进制格式写入文件.
谢谢,
-m
前段时间遇到类似情况时,我用MSXML 在将数据保存到文件之前将其转换为字节数组.您将需要版本 3 或更高版本.
要做到这一点,你会:
- 使用 MSXML 加载数据
- 设置节点的
dataType
属性到bin.base64
- 使用
nodeTypedValue
属性 - 要保存文件,您可以使用 ADODB.流 组件.
下面是一些关于如何做到这一点的链接.
http://ghads.wordpress.com/2008/10/17/vbscript-readwrite-binary-encodedecode-base64/
http://support.microsoft.com/kb/254388
http://www.motobit.com/tips/detpg_binasp/p>
I am trying to convert a base64binary string to a byte array in classic ASP. StrConv() doesn't exist in ASP.
My objective is to take the base64binary string received from a web service call, and write the binary format to a file.
thanks,
-m
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.
To do this you would:
- 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.wordpress.com/2008/10/17/vbscript-readwrite-binary-encodedecode-base64/
http://support.microsoft.com/kb/254388
http://www.motobit.com/tips/detpg_binasp/
这篇关于ASP Classic - 将 base64binary 字符串转换为字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!