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

如何将十六进制值解析为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 关注
  • 666 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号