开发者

How to convert number (dec) to binary (bin) number and from bin to dec?

How to convert number (dec) to binary (bin) number and from bin to dec 开发者_Python百科using C# and Winforms?


Try this

string binValue = Convert.ToString(myInt, 2);

int intValue = Convert.ToInt32(myBinary, 2);

Example:

 string binValue = Convert.ToString(16, 2); // = 10000

 int intValue = Convert.ToInt32("11010", 2);  // = 26
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜