System.Decimal (# decimal) NumberStyles.HexNumber. System.Int32 (# int) . System.Int64 (# long):
string s = "10C5EC9C6";
long n = Int64.Parse(s, System.Globalization.NumberStyles.HexNumber);
'n ==> 4502505926
, decimal :
decimal d = (decimal)Int64.Parse(s, System.Globalization.NumberStyles.HexNumber);
.
string s = "1 12 94 201 198";
string[] groups = s.Split();
long result = 0;
foreach (string hexGroup in groups) {
result = 256 * result + Int32.Parse(hexGroup);
}
Console.WriteLine(result);
, 16 * 16 = 256.