实现效果:
知识运用:
Reistry类的SetValue
实现代码:
private void button1_Click(object sender, EventArgs e) { Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Directory\\shell\\Open_Command","","在命令行打开"); Registry.SetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\Directory\\shell\\Open_Command\\Command", "", "cmd.exe %1"); }