I가 사용하는 레지스트리 액세스를 요구하는 기존 프로그램 :C# 읽기 레지스트리 윈도우 8
RegistryPermission permission = new RegistryPermission(RegistryPermissionAccess.AllAccess, strCheckPermission);
permission.Demand();
이 Windows 7 및 Windows Server 2003 및 그러나 2008 년까지 Windows XP 용 잘 작동, 내가 실행할 때 나는이 권한 세트를 요구할 때이 윈도우 8에, 난 여전히 하위 키
를 만들 수 없습니다Registry.LocalMachine.OpenSubKey("Software", true).CreateSubKey("myCompany")
사람이 여기에 잘못 무슨 일이 일어나고 있는지 알고 있나요?
업데이트 : 예외의 스택 트레이스 :
System.UnauthorizedAccessException: Cannot write to the registry key.
at Microsoft.Win32.RegistryKey.EnsureWriteable()
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
예외가 있습니까? 그렇다면 전체 내용을 게시하십시오. – Polyfun
사용자는 해당 레지스트리 하이브에 액세스 할 수있는 권한이 있어야합니다. Windows 8에서 코드를 실행하는 데 아무런 문제가 없었습니다. –
@Ramhound가 무엇을 말했는지 확인하기 위해 Windows 8에서도이 문제를 해결할 수 있습니다. Visual Studio를 관리자로 실행하고 디버깅을 시도하십시오. – JMK