[高手向]C#操作注册表如果遇到名称为"(默认)"的玩意怎么办?

vpoint2009 2010-10-11 08:07:18
 RegistryKey pregkey = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths");//获取指定路径下的键

 object displayName = null, installString = null

displayName = currentKey.GetValue("DisplayName");           //获取显示名称
installString = currentKey.GetValue("???"); //获取路径


在“???”的地方,注册表写的是“(默认)”,我试过:
installString = currentKey.GetValue("(默认)"); 没用!
installString = currentKey.GetValue("默认"); 没用!
installString = currentKey.GetValue("default"); 还是没用!

请问该写什么呢?
...全文
196 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
vpoint2009 2010-10-12
  • 打赏
  • 举报
回复
...拜谢大牛~~
gomoku 2010-10-12
  • 打赏
  • 举报
回复
currentKey.GetValue( "" );

111,129

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧