Use ToString("X4").
The 4 means that the string will be 4 digits long.
Reference: The Hexadecimal (“X”) Format Specifier on MSDN.
Use ToString("X4").
The 4 means that the string will be 4 digits long.
Reference: The Hexadecimal (“X”) Format Specifier on MSDN.