实现效果:
知识运用:
RegistryKey类的DeleteValue方法
实现代码:
private void button1_Click(object sender, EventArgs e) { RegistryKey mreg; mreg = Registry.ClassesRoot; mreg = mreg.CreateSubKey("piffile"); mreg.DeleteValue("IsShortcut"); mreg.Close(); RegistryKey mreg2; mreg2 = Registry.ClassesRoot; mreg2 = mreg2.CreateSubKey("lnkfile"); mreg2.DeleteValue("IsShortcut"); mreg2.Close(); RefreshSystem(); MessageBox.Show("去除完毕!!"); }