How do I convert 0xFFFF to an int32 in c# [duplicate]
Possible Duplicates:
Convert a string containing a hexadecimal value starting with “0x” to an integer or long in C# How to pa开发者_JAVA技巧rse hex values into a uint?
I have a textbox that can have "0xFFFF" in it's Text property. I need to convert it to an int32.
How do I do that? I have tried:
Int32.Parse( MyTextBox.Text, NumberStyles.HexNumber )
and
Int32.Parse( MyTextBox.Text, NumberStyles.AllowHexSpecifier)
and get the following error message:
"Input string was not in a correct format."
Please help!
take off the 0x and just parse the actual hex number.
精彩评论