//设置自启动
private void setStart_Click(object sender, EventArgs e)
{
RegistryKey R_local = Registry.LocalMachine;
RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
R_run.SetValue("test", Application.ExecutablePath);
R_run.Close();
R_local.Close();
}
//取消自启动
private void button3_Click(object sender, EventArgs e)
{
RegistryKey R_local = Registry.LocalMachine;
RegistryKey R_run = R_local.CreateSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run");
R_run.DeleteValue("test", false);
R_run.Close();
R_local.Close();
}
12-19
2735
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
03-10
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交