# 禁用系统功能
# 1. 禁用任务管理器
代码语言:javascript
复制//禁用
var subKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", RegistryKeyPermissionCheck.ReadWriteSubTree);
subKey.SetValue("DisableTaskMgr", "1");
//启用
RegistryKey subKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System");
subKey.DeleteValue("DisableTaskMgr");
# 2. 禁用注册表(测试无效)
代码语言:javascript
复制//禁用
var subKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System", RegistryKeyPermissionCheck.ReadWriteSubTree);
subKey.SetValue("DisableRegistryTools", "1");
//启用
RegistryKey subKey = Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\CurrentVersion\Policies\System");
subKey.DeleteValue("DisableRegistryTools");
# 3. 修改桌面管理器(explorer.exe)为自己的程序
代码语言:javascript
复制RegistryKey subKey = Registry.LocalMachine.CreateSubKey(@"SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon");
//这个值设置为自己的程序
subKey.SetValue("Shell", @"D:Test.exe");
//恢复
RegistryKey subKey = Registry.LocalMachine.CreateSubKey(@"SOFTWAREMicrosoftWindows NTCurrentVersionWinlogon");
subKey.SetValue("Shell", "explorer.exe");