VB程序求解
--------------------编程问答-------------------- 什么意思啊?那个数据,在计算机内,不就是以“二进制”存储的吗。
看你贴的那段代码,是想得到一个字节数值的二进制码字符串?
如果是这样,可以参考这段代码:
Private Function GetBinText(ByVal lValue As Long) As String
Const s1 As String = "0000101001101111000"
Const s2 As String = "0125A4936DB7FEC8"
Dim i As Long, sBin As String, sHex As String
sHex = Hex$(lValue)
For i = 1 To Len(sHex)
sBin = sBin & Mid$(s1, InStr(1, s2, Mid$(sHex, i, 1)), 4)
Next i
GetBinText = sBin
End Function
'应用示例:
temp = GetBinText(MyItems.Item(11))
'如果你只要低字节的低6位:
temp = Right$(GetBinText(MyItems.Item(11)), 6)
补充:VB , 基础类