【发布时间】:2020-12-28 09:33:10
【问题描述】:
https://i.stack.imgur.com/6KXds.png
我想在 Explorer.exe 中打开 Location String
try
{
using (RegistryKey key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Wilcom\Wilcom EmbroideryStudio\4.2H"))
{
if (key != null)
{
Object o = key.GetValue("Location");
if (o != null)
{
Version version = new Version(o as String); //"as" because it's REG_SZ...otherwise ToString() might be safe(r)
Process.Start(key.GetValue("Location").ToString());
}
}
}
}
catch (Exception ex) //just for demonstration...it's always best to handle specific exceptions
{
//react appropriately
}
它不工作。请帮忙。
【问题讨论】:
标签: c# process location registry key-value