我正在编写一个程序来查找创建时间和修改时间。如果我有一个字节数组,那么我将 4 个字节转换为一个整数。如何将整数转换为时间?
byte []a = new byte [8];
a[0] = 5;
a[1] = 8;
a[2] = 0;
a[3] = 19;
a[4] = 77;
a[5] = 54;
a[6] = 0;
a[7] = 9;
//convert byte into integer
Int32 creationtime = BitConverter.ToInt32(a,0);
Int32 modificationtime = BitConverter.ToInt32(a, 4);