[vb]代码库
Option Explicit
Dim aa$, bb$, i&
Private Sub Form_Load()
Command1.Caption = "汉转16"
Command2.Caption = "16转汉"
Command1.Enabled = True
Command2.Enabled = False
Text1.Text = "我爱VB"
End Sub
Private Sub Command1_Click()
aa = Text1.Text
Text1.Text = ""
For i = 1 To Len(aa)
Text1.Text = Text1.Text & Hex(Asc(Mid(aa, i, 1))) & " "
Next i
Command1.Enabled = Not Command1.Enabled
Command2.Enabled = Not Command2.Enabled
End Sub
Private Sub Command2_Click()
Dim s
aa = Trim(Text1.Text)
Text1.Text = ""
s = Split(aa, " ")
For i = 0 To UBound(s)
Text1.Text = Text1.Text & Chr("&H" + s(i))
Next i
Command1.Enabled = Not Command1.Enabled
Command2.Enabled = Not Command2.Enabled
End Sub
[代码运行效果截图]
中级程序员
by: smilepcc 发表于:2014-04-12 16:34:05 顶(0) | 踩(0) 回复
很好用
回复评论