2013-01-20 68 views

回答

7

最簡單的方法是使用

string result = Convert.ToString(num, 2).PadLeft(8, '0'); 
+0

+1。優秀(和簡潔)的答案。 –