请问,怎么将byte[] 转化为字符串

coo2 2004-07-26 11:49:01
给段有效的程序好吗?
...全文
234 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
zdrone 2004-07-26
  • 打赏
  • 举报
回复
进者有分
yinweihong 2004-07-26
  • 打赏
  • 举报
回复
dim ByteArray as Byte[]
dim str as string
str=""
for i=Lbound(ByteArray) to Ubound(ByteArray)
str= str & ByteArray(i)
next
print str
coo2 2004-07-26
  • 打赏
  • 举报
回复
谢谢大家的帮助~~
ccidtobe 2004-07-26
  • 打赏
  • 举报
回复
cstr()函数就可以了
Geo_Cra 2004-07-26
  • 打赏
  • 举报
回复
To Chice
我准备度个星出来
按照现在三天65的速度,看来是有问题啦……
pigpag 2004-07-26
  • 打赏
  • 举报
回复
Unicode的就不需要StrConv了
Chice 2004-07-26
  • 打赏
  • 举报
回复
TO Geo_Cra(锺意阿芙洛蒂忒)
我晕,你怎么也……

呵呵~~~~~~~
Chice 2004-07-26
  • 打赏
  • 举报
回复
StrConv(mybyte, vbUnicode)
StrConv(mybyte, vbFromUnicode)
etc...
是正确的。

不排除其他方法,但用chr()方式会丢失字符。不要用。

Geo_Cra 2004-07-26
  • 打赏
  • 举报
回复
StrConv是王道
northwolves 2004-07-26
  • 打赏
  • 举报
回复
Private Sub Command1_Click()
Dim mybyte(49) As Byte, i As Integer, s As String
For i = 0 To 49
mybyte(i) = 200 + i
Next
s = StrConv(mybyte, vbUnicode)
MsgBox s
End Sub
熊孩子开学喽 2004-07-26
  • 打赏
  • 举报
回复
Dim I as long
Dim Str as String
Dim Bytes(100) as byte
...
...
for I=0 to 100
str=str & chr(Bytes(I))
next

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧