Hi Dave,
Because the documentation says, "Strings parsed with this style are not
permitted to be prefixed with 0x".
[System.Globalization.NumberStyles.AllowHexSpecifie r]
HexNumber incorporates the AllowHexSpecifier flag in its value.
The code works if you remove the "0xH" prefix.
Hans mentioned in his response that the number is greater than what fits in a
signed Int32. The Parse method won't throw an exception but you might not get
the value you expect. Try uint and uint.Parse instead if that causes a
problem for you.
--
Dave Sexton
"bungle" <bu****@wizardbuy.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi,
Would anyone be able to explain why I get a "Input string was not in a
correct format" on the following bit of code in C#??
public static int GENERIC_READ =
int.Parse("0xH80000000",System.Globalization.Numbe rStyles.HexNumber,
null);
Thanks
Dave Court