任务管理器
2016-05-13 11:13
288 查看
/// <summary>
/// 管理任务管理器的方法
/// </summary>
/// <param name="arg">0:启用任务管理器 1:禁用任务管理器</param>
private void ManageTaskManager(int arg)
{
RegistryKey currentUser = Registry.CurrentUser;
RegistryKey system = currentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System",true );
//如果system项不存在就创建这个项
if (system == null)
{
system = currentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
}
system.SetValue("DisableTaskmgr", arg, RegistryValueKind.DWord);
currentUser.Close();
}
/// 管理任务管理器的方法
/// </summary>
/// <param name="arg">0:启用任务管理器 1:禁用任务管理器</param>
private void ManageTaskManager(int arg)
{
RegistryKey currentUser = Registry.CurrentUser;
RegistryKey system = currentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System",true );
//如果system项不存在就创建这个项
if (system == null)
{
system = currentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\System");
}
system.SetValue("DisableTaskmgr", arg, RegistryValueKind.DWord);
currentUser.Close();
}
相关文章推荐
- C++那些事儿
- 手把手教你写《雷神》游戏(二)
- 如何判断一个数是2的幂?
- 关于提高应用库的平台可移植性
- PHP问题 —— Notice: Undefined index:
- PHP问题 —— Notice: Undefined index:
- js对字符串进行编码方法总结
- iOS TextFiled 文本密码切换 光标偏移解决
- 344. Reverse String
- gulp详细入门教程
- 谈谈iOS中粘性动画以及果冻效果的实现
- 游戏植入广告获取收益
- javascript 常用实用函数。。。。。。
- java实现二分查找
- session管理
- java的五种数据类型解析
- 信号量与互斥锁
- linux环境知识点备忘录
- java中的泛型
- windows下的汇编学习