标签:运用 current cmd value private 实现 child software tar
实现效果:
知识运用:
RegistryKey类的CreateSubKey和SetValue方法
实现代码:
private void button1_Click(object sender, EventArgs e) { RegistryKey regMain; RegistryKey regChild; regMain = Registry.CurrentUser; regChild = regMain.CreateSubKey(@"Software\Policies\Microsoft\Windows\System"); regChild.SetValue("DisableCMD",1); regChild.Close(); MessageBox.Show("禁止成功!"); } private void button2_Click(object sender, EventArgs e) { RegistryKey regMain; RegistryKey regChild; regMain = Registry.CurrentUser; regChild = regMain.CreateSubKey(@"Software\Policies\Microsoft\Windows\System"); regChild.SetValue("DisableCMD", 0); regChild.Close(); MessageBox.Show("禁止成功!"); }
标签:运用 current cmd value private 实现 child software tar
原文地址:https://www.cnblogs.com/feiyucha/p/10335856.html