首页 > 应用开发 > > WIN10中.NET注册开启启动
我用的代码是
RegistryKey hkml = Registry.LocalMachine;
RegistryKey aimdir = hkml.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
if (aimdir != null)
{
aimdir.SetValue(Application.ExecutablePath, "****");
}
win7 下没有问题,但是win10如果不设置管理员操作权限就报错,具体信息如下

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1976/viewspace-3134005/ ,如需转载,请注明出处,否则将追究法律责任。