实现效果:

知识运用:
RegistryKey类的CreateSubKey方法
RegistryKey类的SetValue方法
实现代码:
private void button1_Click(object sender, EventArgs e)
{
RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer");
regKey.SetValue("NoRun",1);
MessageBox.Show("禁用\"开始\"行成功!");
RefreshSystem();
}
private void button2_Click(object sender, EventArgs e)
{
RegistryKey regKey = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Windows\CurrentVersion\Policies\Explorer");
regKey.SetValue("NoRun", 0);
MessageBox.Show("开启\"开始\"行成功!");
RefreshSystem();
}
原文:https://www.cnblogs.com/feiyucha/p/10332120.html