为了账号安全,请及时绑定邮箱和手机立即绑定

如何将十六进制值解析为uint?

如何将十六进制值解析为uint?

C#
拉风的咖菲猫 2019-10-21 12:54:50
uint color; bool parsedhex = uint.TryParse(TextBox1.Text, out color); //where Text is of the form 0xFF0000if(parsedhex)   //...不起作用。我究竟做错了什么?
查看完整描述

3 回答

?
慕尼黑的夜晚无繁华

TA贡献1864条经验 获得超6个赞

尝试


Convert.ToUInt32(hex, 16)  //Using ToUInt32 not ToUInt64, as per OP comment


查看完整回答
反对 回复 2019-10-21
  • 3 回答
  • 0 关注
  • 643 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信