读取的时候要用为二进制函数,看高字节是不是大于128,如大于128是汉字,我提供一些代码给,是专门处理汉字与字符混合的。
我是把文本转化为ASCII码,只此而已,希望对你有所帮忙.
Private Sub Command1_Click()
Dim LenStr As Integer
Dim a() As Byte
Dim str As String
Dim ValeTemp As Long
Dim k As Integer
k = 0
Text2.Text = ""
LenStr = LenB(StrConv(Text1.Text, vbFromUnicode))
ReDim a(LenStr)
str = "&H"
For i = 1 To LenStr
a(i) = AscB(MidB(StrConv(Text1.Text, vbFromUnicode), i, 1))
If a(i) > 128 Then
k = k + 1
str = str & Hex$(a(i))
ValeTemp = str
If k = 2 Then
If Text2.Text <> "" Then
Text2.Text = Text2.Text & " " & Chr(ValeTemp) & ":" & CStr(ValeTemp)
k = 0
str = "&H"
Else
Text2.Text = Chr(ValeTemp) & ":" & CStr(ValeTemp)
k = 0
str = "&H"
End If
End If
Else
str = str & Hex$(a(i))
ValeTemp = str
If Text2.Text <> "" Then
Text2.Text = Text2.Text & " " & Chr(ValeTemp) & ":" & CStr(ValeTemp)
str = "&H"
Else
Text2.Text = Chr(ValeTemp) & ":" & CStr(ValeTemp)
str = "&H"
End If
End If
Next
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Command3_Click()
Text5.Text = Exp(Log(Val(Text3.Text)) / Val(Text4.Text))
End Sub
温馨提示:答案为网友推荐,仅供参考