fork download
  1. using System;
  2. using System.Text;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8. Int32 value = 5152;
  9. byte[] bytes = new byte[4];
  10. for (int i = 0; i < 4; i++)
  11. {
  12. bytes[i] = (byte)((value >> i * 8) & 0xFF);
  13. }
  14.  
  15. StringBuilder result = new StringBuilder();
  16. for (int i = 0; i < 4; i++)
  17. {
  18. result.Append("\\" + bytes[i].ToString("X2"));
  19. }
  20.  
  21. Console.WriteLine(result);
  22. }
  23. }
Success #stdin #stdout 0.04s 23960KB
stdin
Standard input is empty
stdout
\20\14\00\00