2013-02-01 37 views

回答

3

可以使用BitConverter class

dim i16a, i16b as short 
dim i32 as integer = somevalue 
dim b() as byte 

b = BitConverter.GetBytes(i32) 
i16a = BitConverter.ToInt16(b, 0) 
i16b = BitConverter.ToInt16(b, 2) 

您可以重構相同的方法,只需將4個字節複製到單個數組中,然後再使用BitConverter.ToInt32。

相關問題