private static RegistryKey GetRegistryPath(RegistryKey key)
{
// パスを取得
string basePath;
if (key == Registry.LocalMachine)
{
basePath = "SOFTWARE";
}
else
{
basePath = "Software";
}
var path = string.Format(@"{0}\{1}\{2}",
basePath,
Application.CompanyName,
Application.ProductName);
// パスのレジストリ・キーの取得(および作成)
return key.CreateSubKey(path);
}