'双字节字符转换为ansi
Function AnsiCode(vstrIn As String) As String
Dim i As Integer, strReturn As String, innerCode, ThisChr
Dim Hight8 As Integer, Low8 As Integer
strReturn = ""
For i = 1 To Len(vstrIn)
ThisChr = Mid(vstrIn, i, 1)
If Abs(Asc(ThisChr)) < &HFF Then
If Abs(Asc(ThisChr)) < &HF Then
strReturn = strReturn & "0" & Hex(Asc(ThisChr))
Else
strReturn = strReturn & Hex(Asc(ThisChr)) & " "
End If
Else
innerCode = Asc(ThisChr)
If innerCode < 0 Then
innerCode = innerCode + &H10000
End If
Hight8 = (innerCode And &HFF00) \ &HFF
Low8 = innerCode And &HFF
strReturn = strReturn & Hex(Hight8) & " " & Hex(Low8) & " "
End If
Next
AnsiCode = strReturn
End Function