![](/img/trans.png)
[英]How to assign new rights (ACL) to existing registry key without inheriting rights from parent
[英]how to get registry key without having administrator rights in windows 7 OS
在我的應用程序(Windows C#.net)中,我試圖獲取注冊表項。 在Windows XP(有和沒有管理員權限)它工作正常,在Windows 7與管理員權限,它工作正常。 但是在我嘗試獲取注冊表項時沒有管理員權限的Windows 7中,應用程序正在崩潰。
我使用以下代碼來獲取注冊表項
Microsoft.Win32.RegistryKey rgKey = Microsoft.Win32.Registry.LocalMachine.CreateSubKey(rgPath);
有些幫助可以在Windows 7中獲得沒有管理員權限的注冊表項。
提前致謝。
沒有管理員權限,無法在Windows7中完成。
這是它的解決方案。
打開項目並轉到proejct菜單並選擇添加新項目。 將有一個名為“Application Manifest File”的項目。 將其添加到您的項目中。 將打開一個看起來像xml的文件。
在該文件中搜索以下行。
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
並用這條線替換它
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
保存文件並重建解決方案。 現在,您的軟件每次在Windows7上執行之前都會要求管理員權限。
請享用 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.