封封窝

还没有想好

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
Public Function AsciiToHex(strChinese As String) As String                 '汉字转16进制ASCII
        Dim iLen     As Long
        iLen = Len(strChinese)
        Dim tmpByte()     As Byte
         
        Dim iNext     As Long     '循环所用字段
        Dim iTmp     As Integer
        Dim strTmp     As String
        For iNext = 1 To iLen
              iTmp = Abs(Asc(Mid(strChinese, iNext, 1)))
              If iTmp > 127 Then                                                               '汉字编码
                  tmpByte = StrConv(Mid(strChinese, iNext, 1), vbFromUnicode)
                  strTmp = strTmp & Hex(tmpByte(0))
                  strTmp = strTmp & Hex(tmpByte(1))
              Else
                strTmp = strTmp & Hex(iTmp)
              End If
        Next
        AsciiToHex = strTmp
  End Function
posted on 2006-06-01 18:22  封封  阅读(4589)  评论(1编辑  收藏  举报