How to convert numbers between hexadecimal and decimal

前端 未结 17 1315
情歌与酒
情歌与酒 2020-11-22 05:30

How do you convert between hexadecimal numbers and decimal numbers in C#?

17条回答
  •  不知归路
    2020-11-22 06:11

    It looks like you can say

    Convert.ToInt64(value, 16)
    

    to get the decimal from hexdecimal.

    The other way around is:

    otherVar.ToString("X");
    

提交回复
热议问题