方法一:byte a = 3; //定义变量int b = Marshal.SizeOf(a.GetType()); //获取长度方法二:byte[] myBytes = new byte[5] { 1, 2, 3, 4, 5 }; BitArray myBA = new BitArray(myBytes); int c=myBA.Length
byte[] a = new byte[0x100];a.Length即为所求