程序在XP上一切正常,而在Windows 7(没环境测试Vista,估计也会有这情况)上,在读写注册表的时候,类似
RegistryKey reg = Registry.ClassesRoot.OpenSubKey("*", true);
会抛出System.Security.SecurityException异常,必需要用管理员权限运行该程序才行请问要如何何必代码,才能让这些需要权限的代码正常运行呢?环境:
Windows 7 RC
基于.NET Framework 2.0