日期:2012-11-25  浏览次数:20373 次

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