Why not change the DecToHex
method to accept long instead.
FileInfo.Length
returns a long and you can use a long as the parameter for string.Format
.
public static string DecToHex(long decValue)
{
return string.Format("{0:x}", decValue);
}