VB PDU mode 7 bit 解码
2004-11-18 19:43
375 查看
Dim tep As String
Dim temp As String
Dim i As Integer
Dim B As Integer
Dim rems As String
tep = rmsg
i = Len(tep)
If i < 1 Then Exit Function
B = i / 2
If i = B * 2 Then
tep = Left(tep, B * 2)
Else
B = B - 1
tep = Left(tep, B * 2)
End If
chg7 = ""
rems = ""
Dim trint As Integer
Dim strtmp As String
trint = 1
strtmp = ""
For i = 1 To B
temp = "&H" & Mid(tep, (i - 1) * 2 + 1, 2)
temp = D_To_B(Val(temp)) '转二进制
If Len(temp) < 8 Then
temp = strpla(8 - Len(temp)) + temp
End If
strtmp = Mid(temp, trint + 1, 8 - trint) + rems
rems = Mid(temp, 1, trint)
chg7 = chg7 & ChrW(CInt(Val(B_To_D(strtmp))))
trint = trint + 1
If trint = 8 Then
trint = 1
chg7 = chg7 & ChrW(CInt(Val(B_To_D(rems))))
rems = ""
End If
Next i
Dim temp As String
Dim i As Integer
Dim B As Integer
Dim rems As String
tep = rmsg
i = Len(tep)
If i < 1 Then Exit Function
B = i / 2
If i = B * 2 Then
tep = Left(tep, B * 2)
Else
B = B - 1
tep = Left(tep, B * 2)
End If
chg7 = ""
rems = ""
Dim trint As Integer
Dim strtmp As String
trint = 1
strtmp = ""
For i = 1 To B
temp = "&H" & Mid(tep, (i - 1) * 2 + 1, 2)
temp = D_To_B(Val(temp)) '转二进制
If Len(temp) < 8 Then
temp = strpla(8 - Len(temp)) + temp
End If
strtmp = Mid(temp, trint + 1, 8 - trint) + rems
rems = Mid(temp, 1, trint)
chg7 = chg7 & ChrW(CInt(Val(B_To_D(strtmp))))
trint = trint + 1
If trint = 8 Then
trint = 1
chg7 = chg7 & ChrW(CInt(Val(B_To_D(rems))))
rems = ""
End If
Next i
相关文章推荐
- VB PDU mode UCS2 解码
- VB版人物---第四期:online(龙卷风)
- VB版第三期人物---yoki
- VB版人物---第二期: ghj1976
- VB版人物---第一期:TechnoFantasy
- Helix流媒体服务器架设及RMVB制作教程
- 这段可笑的代码更坚定了我在VB.NET上的信心了
- vbs调用WebService
- 浅谈Excel 的VB编程
- TVB
- VBScript的参数引用
- ILoveYou源程序与程序分析
- XML创建可排序、分页的数据显示页面
- Visual Basic .NET 语法摘要
- 蛙蛙推荐:VB开发规范讨论.doc
- 蛙蛙推荐:VB编码规范.doc
- 蛙蛙推荐:C程序开发规范.doc
- HOW TO:使用嵌套 Repeater 控件和 Visual Basic .NET显示分层数据
- 使用vbscript脚本调用web服务
- 在VB6中校验XML文档