Hi,
hier hab ich noch einen Code, mit dem man ein Byte in die einzelnden Bits (als String) zerlegen kann:
vG,
Lupus
hier hab ich noch einen Code, mit dem man ein Byte in die einzelnden Bits (als String) zerlegen kann:
VB.NET-Quellcode
- Function aufteilen(ByVal b As Byte) As String
- Dim text As String = "00000000"
- Dim i As Integer = 0
- For a As Integer = 8 To 1 Step -1
- i = 128 / Math.Pow(2, 8 - a) 'aktuelle Zweierpotenz bestimmen
- If b > i Then
- b -= i
- text = text.Substring(0, 8 - a) & "1" & text.Substring(8 - a + 1)
- End If
- Next
- Return text
- End Function
vG,
Lupus