vb.net16转2,vb16进制转2进制代码

vb.net 中2、8、10、16进制转换代码怎么写

Option Explicit

成都创新互联公司坚持“要么做到,要么别承诺”的工作理念,服务领域包括:网站设计制作、网站设计、企业官网、英文网站、手机端网站、网站推广等服务,满足客户于互联网时代的全椒网站设计、移动媒体设计的需求,帮助企业找到有效的互联网解决方案。努力成为您成熟可靠的网络建设合作伙伴!

Dim Jz As Integer, K As Boolean

Private Sub Command1_Click()

Pic.Cls

If K Then Jz = Val(Qtjz.Text)

If Pd(Text1.Text, Jz) Then Pic.Print "选择的进制与数不符": Exit Sub

If Jz = 0 Then Pic.Print "请先输入进制" Else Pic.Print Zh(Text1.Text, Jz)

End Sub

Private Sub Command2_Click()

End

End Sub

Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Option1_Click(Index As Integer)

K = False

Select Case Index

Case 0

Jz = 2

Case 1

Jz = 8

Case 2

Jz = 10

Case 3

Jz = 16

Case 4

K = True

Qtjz.Text = ""

Qtjz.SetFocus

End Select

If Index 4 Then Command1.SetFocus

End Sub

Private Sub Qtjz_Click()

Qtjz.Text = ""

End Sub

Private Sub Text1_Click()

Text1.Text = ""

End Sub

Private Function Zh(a As String, b As Integer) As Integer

Dim c As String, i, d As Integer

a = LCase(a)

For i = 1 To Len(a)

c = Mid(a, Len(a) + 1 - i, 1)

If Asc(c) 96 Then d = Asc(c) - 87 Else d = Val(c)

Zh = Zh + d * b ^ (i - 1)

Next i

End Function

Private Function Pd(a As String, b As Integer) As Boolean

Dim c As String, i, d As Integer

Pd = False

For i = 1 To Len(a)

c = Mid(a, Len(a) + 1 - i, 1)

If Asc(c) 96 Then d = Asc(c) - 87 Else d = Val(c)

If d b - 1 Then Pd = True: Exit Function

Next i

End Function

VB.NET中怎么把16进制数的最后2位取出来啊,并转换成字符串啊,

a="habcd"

if len(a)=2 then

msgbox "0" right(a,1)

else

msgbox right(a,2)

end if

VB中16进制转2进制,然后取反加1后,再转16进制,怎么实现?求代码,谢谢!

Hex((Not 十六进制数)+1)

“十六进制数”,你写 上具体的数字或变量


网页题目:vb.net16转2,vb16进制转2进制代码
链接地址:http://cdiso.cn/article/dschigp.html

其他资讯