2015-03-19 86 views
-3

美好的一天! 如何使用如何從1打印0x00000001

Console.Writeline() 
  • int值作爲十六進制值打印: 例如:1->量0x000 ... 01;

謝謝!

+0

這可能有助於http://stackoverflow.com/questions/1139957/c-sharp-convert-integer-to-hex-and-back-again – 2015-03-19 11:06:37

+0

JGeerWM的鏈接重複答案回答你的問題。 – Heinzi 2015-03-19 11:07:19

+0

@Heinzi [這個問題](http://stackoverflow.com/questions/642417/how-do-you-convert-hex-to-decimal-using-vb-net)比你提供的更好,也許把它改成那個? – cybermonkey 2015-03-19 11:08:04

回答

1
int x = 1; 
Console.WriteLine(x.ToString("X8")); 

'8'代表想要用十六進制數字顯示的位數。

相關問題