private byte[] bitwert = { 128, 64, 32, 16, 8, 4, 2, 1 };
private byte[] bits = new byte[8];
public string dec2bin(byte Bytewert)
{
string bitstring = string.Empty; for (int Counter = 0; Counter < 8; Counter++)
{
if (Bytewert >= bitwert[Counter])
{
bits[Counter] = 1; Bytewert -= bitwert[Counter];
}
bitstring += Convert.ToString(bits[Counter]);
}
return bitstring;
}