任务管理器


        /// <summary>

        /// 管理任务管理器的方法
        /// </summary>
        /// <param name="arg">0:启用任务管理器 1:禁用任务管理器</param>
        private void ManageTaskManager(int arg)
        {
            RegistryKey currentUser = Registry.CurrentUser;
            RegistryKey system = currentUser.OpenSubKey(@"SoftwareMicrosoftWindowsCurrentVersionPoliciesSystem",true );
            //如果system项不存在就创建这个项
            if (system == null)
            {
                system = currentUser.CreateSubKey(@"SoftwareMicrosoftWindowsCurrentVersionPoliciesSystem");
            }
            system.SetValue("DisableTaskmgr", arg, RegistryValueKind.DWord);
            currentUser.Close();
        }

原文地址:https://www.cnblogs.com/hz1234/p/5488704.html