Function bytes2BSTR(vIn)

来源:互联网 发布:小熊棋牌源码 编辑:程序博客网 时间:2024/06/05 10:18
Function bytes2BSTR(vIn)
     dim strReturn
     dim i,ThisCharCode,NextCharCode
     strReturn = ""
     For i = 1 To LenB(vIn)
     ThisCharCode = AscB(MidB(vIn,i,1))
     If ThisCharCode < &H80 Then
     strReturn = strReturn & Chr(ThisCharCode)
     Else
     NextCharCode = AscB(MidB(vIn,i+1,1))
     strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
     i = i + 1
     End If
     Next
     bytes2BSTR = strReturn
End Function
原创粉丝点击