2, 8, 10, 16进制转换.
先记下先
1
//十进制转二进制
2
Console.WriteLine("十进制166的二进制表示: "+Convert.ToString(166, 2));
3
//十进制转八进制
4
Console.WriteLine("十进制166的八进制表示: "+Convert.ToString(166, 8));
5
//十进制转十六进制
6
Console.WriteLine("十进制166的十六进制表示: "+Convert.ToString(166, 16));
7
8
//二进制转十进制
9
Console.WriteLine("二进制 111101 的十进制表示: "+Convert.ToInt32("111101", 2));
10
//八进制转十进制
11
Console.WriteLine("八进制 44 的十进制表示: "+Convert.ToInt32("44", 8));
12
//十六进制转十进制
13
Console.WriteLine("十六进制 CC的十进制表示: "+Convert.ToInt32("CC", 16));
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
9
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
10
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
11
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
12
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
13
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
posted on 2008-06-26 11:13 Junda.chen 阅读(364) 评论(0) 编辑 收藏 举报