VB PDU US2 编码

类别:.NET开发 点击:0 评论:0 推荐:
  Public Function ascg(smsg As String) As String
    Dim si, sb As Integer
    Dim stmp As Integer
    Dim stemp As String
    sb = Len(smsg)
    ascg = ""
    For si = 1 To sb
     stmp = AscW(Mid(smsg, si, 1))
     If Abs(stmp) < 127 Then
        stemp = "00" & Hex(stmp)
     Else
        stemp = Hex(stmp)
     End If
     ascg = ascg & stemp
    Next si
    ascg = Trim(ascg)
 End Function

本文地址:http://com.8s8s.com/it/it42620.htm