development:csharp:byte_to_bin_and_vice_versa

C# Converting byte to binary string and vice versa

string a = Convert.ToString(value, 2).PadLeft(8, '0');   // Convert byte (value) to binary string
byte a = Convert.ToByte(NewFlags, 2);                    // Convert binary string to byte
  • development/csharp/byte_to_bin_and_vice_versa.txt
  • Last modified: 2021/05/19 12:17
  • by 127.0.0.1