If you want just to obtain hexadecimal representation, you can do it in one go:
// 16069c
string value = Convert.ToString(array[1], 16);
Or
string value = array[1].ToString("x");
Or (padded version: at least 8
characters)
// 0016069c
string value = array[1].ToString("x8");
If you want to manipulate with byte
s try BitConverter
class
byte[] bytes = BitConverter.GetBytes(array[1]);
string value = string.Concat(bytes.Select(b => b.ToString("x2")));
Your code amended:
using System.Runtime.InteropServices; // For Marshal
...
// Marshal.SizeOf - length in bytes (we don't have int.Length in C#)
StringBuilder hex = new StringBuilder(Marshal.SizeOf(array[1]) * 2);
// BitConverter.GetBytes - byte[] representation
foreach (byte b in BitConverter.GetBytes(array[1]))
hex.AppendFormat("{0:x2}", b);
// You can well get "9c061600" (reversed bytes) instead of "0016069c"
// if BitConverter.IsLittleEndian == true
string value = hex.ToString();