C#中二进制的写法

byte byte1 = 0b_0000_0000;
byte byte2 = 0b0100_0000;

亦或

 public enum DataFormat : byte
    {
        List    = 0b_0000_0000,
        Binary  = 0b_0010_0000,
        Boolean = 0b_0010_0100,
        ASCII   = 0b_0100_0000,
    }

其中“_”可有可无

猜你喜欢

转载自www.cnblogs.com/xushitairan/p/10930721.html