争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

[VBS]转换二进制数据为字符串常用方法

时间:2024/7/2作者:未知来源:争怎路由网人气:

VT_ARRAY data To convert To a string
'CharSet - charset of the source binary data - default is "us-ascii"
Function Stream_BinaryToString(Binary, CharSet)
Const adTypeText = 2
Const adTypeBinary = 1

'Create Stream object
Dim BinaryStream 'As New Stream
Set BinaryStream = CreateObject("ADODB.Stream")

'Specify stream type - we want To save text/string data.
BinaryStream.Type = adTypeBinary

'Open the stream And write text/string data To the object
BinaryStream.Open
BinaryStream.Write Binary


'Change stream type To binary
BinaryStream.Position = 0
BinaryStream.Type = adTypeText

'Specify charset For the source text (unicode) data.
If Len(CharSet) > 0 Then
BinaryStream.CharSet = CharSet
Else
BinaryStream.CharSet = "us-ascii"
End If

'Open the stream And get binary data from the object
Stream_BinaryToString = BinaryStream.ReadText
End Function
要存储、获取二进制数据,从一个本地文件、上传的二进制数据文件或者ASP中,可以参考:Pure and Huge ASP file upload with progress.。 Tip keywords: Binary, Byte, Array, VT_UI1, VT_ARRAY, BinaryWrite, BinaryRead, ChrB, InstrB, LeftB, MidB, RightB, ASP, VBSCOPYRIGHT AND PERMITTED USE OF http://www.pstruh.cz/tips WEBSITE. The entire contents of PSTRUH Software website consist of copyright material owned by Antonin Foller, PSTRUH Software.


关键词:[VBS]转换二进制数据为字符串常用办法




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版