0
코드는 다음과 같다 :C 번호 - 사용 안 함 작업 관리자 오류
public void KillCtrlAltDelete()
{
RegistryKey regkey;
string keyValueInt = "1";
string subKey = "Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System";
try
{
regkey = Registry.CurrentUser.CreateSubKey(subKey);
regkey.SetValue("DisableTaskMgr", keyValueInt);
regkey.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
그러나 나는 다음과 같은 오류가 발생했다.
System.UnauthorizedAccessException:Access to the registry key'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.CreateSubKey(String subkey, RegistryKeyPermissionCheck permissionCheck, RegistrySecurity registrySecurity)
at BlockTask.Form1.KillCtrlAltDelete() in C:\Users\ASUS\Documents\Visual Studio 2008\Projects\BlockTask\BlockTask\Form1.cs:line 28
어떻게 수정합니까?
관리자 권한으로 프로그램을 실행하십시오. –
regedit를 사용하여 해당 키로 이동 한 다음 마우스 오른쪽 단추로 클릭하고 사용 권한 ...을 선택합니다. 해당 사용 권한을 설정합니다. – Alex
답변 해 주셔서 감사합니다 :) –