I need to convert int to bin and with extra bits.
string aaa = Convert.ToString(3, 2);
it returns 11, but I need 0011
11
0011
public static String HexToBinString(this String value) { String binaryString = Convert.ToString(Convert.ToInt32(value, 16), 2); Int32 zeroCount = Convert.ToInt32(Math.Ceiling(Convert.ToDouble(binaryString.Length) / 8)) * 8; return binaryString.PadLeft(zeroCount, '0'); }