字符串转换成十六进制

类别:.NET开发 点击:0 评论:0 推荐:
                                        -huitiansou
'字符串转换成十六进制
Public Function StrToHex(ByVal strS As String) As String
    Dim abytS() As Byte
    Dim bytTemp As Byte
    Dim strTemp As String
    Dim lLocation As Long
    abytS = StrConv(strS, vbFromUnicode)
    For lLocation = 0 To UBound(abytS)
        bytTemp = abytS(lLocation)
        strTemp = Hex(bytTemp)
        strTemp = Right("00" & strTemp, 2)
        StrToHex = StrToHex & strTemp
    Next lLocation
End Function

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