From that link Registry Data Types (exists next to value name in registry)
REG_SZ
Null-terminated string. It will be a Unicode or ANSI string, depending on whether you use the Unicode or ANSI functions.
REG_MULTI_SZ
Array of null-terminated strings that are terminated by two null characters.
Depending on that answer just edited it a bit to match your request.
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Control\SystemInformation"))
{
if (key != null)
{
object value = key.GetValue("ComputerHardwareIds");
if (value != null)
{
var computerHardwareIds = (value as string[]); // cast value object to string array, because its type is REG_MULTI_SZ
var lines_num = computerHardwareIds.Length; // then you can get lines number this way
}
}
}