private void SetKey(bool enableTaskManager) { using ( var mKey = Registry.CurrentUser.CreateSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\System")) { if (mKey != null) { mKey.SetValue("DisableTaskMgr", enableTaskManager ? 0 : 1); } } }
时间: 2024-10-17 11:03:23