How to set an ints Hex Literal from a string,

后端 未结 1 1881
耶瑟儿~
耶瑟儿~ 2020-12-21 18:08

Im attempting to load a hex literal from an xml settings file, I can parse the xml just fine and get the required string from the file,

but i cant seem to get it to

相关标签:
1条回答
  • 2020-12-21 19:11

    You have to supply the base of the string to the overloaded method Convert.ToInt32(String value, Int32 fromBase).

    Int32 value = Convert.ToInt32(hexString, 16);
    
    0 讨论(0)
提交回复
热议问题