怎么用VB实现查询 英文汉字数字区位码
如题怎么用VB实现查询 英文汉字数字区位码
用 RichTextBox1 输入
用 RichTextBox2 显示区位码
Function QuWei(ByVal x As String) As String '汉字转区位码 If Asc(x) >= 0 Then Exit Function x = Hex(Asc(x)) QuWei = Format(CDec("&H" & Left(x, 2)) - 160, "00") & Format(CDec("&H" & Right(x, 2)) - 160, "00") End Function Function HanZi(ByVal x As String) As String '区位码转汉字 HanZi = Chr("&H" & Hex(Val(Left(x, 2)) + 160) & Hex(Val(Right(x, 2)) + 160)) End Function Private Sub Command4_Click() Dim strA As String Dim strB As String Dim strZJ As String strA = Text4.Text For i = 1 To Len(strA) strZJ = Mid(strA, i, 1) strZJ = QuWei(strZJ) strB = strB & strZJ & " " Next Text5.Text = strB End Sub