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

相关文章:

  • 2021-09-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-02-13
相关资源
相似解决方案