标签:c#
Numeric Literal Formats = Binary literals and separatorsvar num1 = 1234; // 10 进位 var num2 = 0x1234; // 16 进位
var num3 = 0b1010; // 2 进位,代表的 10 进位数字是 10
var num10 = 12345; var num2 = 0b11000000111001;
var num2 = 0b11_0000_0011_1001;
var num5 = 1_234_567_890; // 10 进位:表示为 123456789 var num6 = 0xFF_FA_88_BC; // 16 进位:换成 10 进位为 4294609084 var num7 = 0b10_01__01_10; // 2 进位:换成 10 进位为 150
[Serializable] [Flags] [System.Runtime.InteropServices.ComVisible(true)] public enum FileAttributes { ReadOnly = 0b00_00_00_00_00_00_01, // 0x0001 Hidden = 0b00_00_00_00_00_00_10, // 0x0002 System = 0b00_00_00_00_00_01_00, // 0x0004 Directory = 0b00_00_00_00_00_10_00, // 0x0010 Archive = 0b00_00_00_00_01_00_00, // 0x0020 Device = 0b00_00_00_00_10_00_00, // 0x0040 Normal = 0b00_00_00_01_00_00_00, // 0x0080 Temporary = 0b00_00_00_10_00_00_00, // 0x0100 SparseFile = 0b00_00_01_00_00_00_00, // 0x0200 ReparsePoint = 0b00_00_10_00_00_00_00, // 0x0400 Compressed = 0b00_01_00_00_00_00_00, // 0x0800 Offline = 0b00_10_00_00_00_00_00, // 0x1000 NotContentIndexed = 0b01_00_00_00_00_00_00, // 0x2000 Encrypted = 0b10_00_00_00_00_00_00 // 0x4000 }
C# 6.0 (C# vNext) 新功能之:Numeric Literal Formats
标签:c#
原文地址:http://blog.csdn.net/kendo3065/article/details/40088623