ASP Classic - 将 base64binary 字符串转换为字节数组 [英] ASP Classic - convert base64binary string to byte array

查看:31
本文介绍了ASP Classic - 将 base64binary 字符串转换为字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 base64binary 字符串转换为经典 ASP 中的字节数组.StrConv() 在 ASP 中不存在.

我的目标是获取从 Web 服务调用接收到的 base64binary 字符串,并将二进制格式写入文件.

谢谢,
-m

解决方案

前段时间遇到类似情况时,我用MSXML 在将数据保存到文件之前将其转换为字节数组.您将需要版本 3 或更高版本.

要做到这一点,你会:

下面是一些关于如何做到这一点的链接.

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 to bin.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆