bytes2BSTR

脚本专栏 发布日期:2024/10/7 浏览次数:1

正在浏览:bytes2BSTR

复制代码 代码如下:
Function bytes2BSTR(vIn) 
 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