I am developing window phone 7 application in silverlight. I am new to the window phone 7 application. I have the long value in String format as follows
String A
In C# int
has 32 bits and long
has 64 bits. Therefore not all values of long
can be int
. Maybe get an array of int
s?
public static int[] ToIntArray(long l)
{
var longBytes = BitConverter.GetBytes(l);
// Get integers from the first and the last 4 bytes of long
return new int[] {
BitConverter.ToInt32(longBytes, 0),
BitConverter.ToInt32(longBytes, 4)
};
}