在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
接上文:http://www.cnblogs.com/TaiYangXiManYouZhe/p/5086974.html 上代码: RegistryKey localKey; if (Environment.Is64BitOperatingSystem) localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64); else localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry32); string value = localKey.OpenSubKey(@"SOFTWARE\Microsoft\Office\15.0\Common\InstallRoot").GetValue("Path").ToString();
很简单,首先,Environment.Is64BitOperatingSystem 判断是否是64位的操作系统。 然后通过注册表打开目录时,传入相应的RegistryView枚举即可。注意:打开注册表时,调用的是OpenBaseKey方法! |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论