In C #, December 2, December 8, and hexadecimal notation are converted to a decimal positive number,
I once thought about the problem of converting other hexadecimal to signed integer. I found it so easy only after I thought of a solution.
1. Int16 (2 bytes ):
Method: Convert. ToInt16 (hexadecimal encoding, hexadecimal)
Convert a and 16 to 10 (with positive and negative values)
Method: Convert. ToInt16 (hexadecimal code, 16 );
Negative number example: (hexadecimal) FFFF = (hexadecimal)-1 solution: C # code: Convert. ToInt16 ("FFFF", 16); Result:-1
Positive number for example: (hexadecimal) 1E0 = (10 hexadecimal) 480 solution: C # code: Convert. ToInt16 ("1E0", 16); Result: 480
Convert B and 8 to 10 (with positive and negative values)
Method: Convert. ToInt16 (octal encoding, 8 );
C, 2 hexadecimal to 10 hexadecimal (with positive and negative)
Method: Convert. ToInt16 (binary encoding, 2 );
2. Int32 (4 bytes in length)
Method: Convert. ToInt32 (hexadecimal encoding, hexadecimal)
3. Int64 (8 bytes)
Method: Convert. ToInt64 (hexadecimal encoding, hexadecimal)