Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C#启动时运行被添加为禁用_C#_Registry_Startup - Fatal编程技术网

C#启动时运行被添加为禁用

C#启动时运行被添加为禁用,c#,registry,startup,C#,Registry,Startup,我正在尝试将应用程序添加到StartUp,当我使用代码将应用程序添加到StartUp注册表时,它会被添加,但当我签入msconfig或taskmgr时,默认情况下它会被禁用。你知道怎么解决这个问题吗?在Windows 8和8.1上测试 RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); rk.SetValue("Test

我正在尝试将应用程序添加到StartUp,当我使用代码将应用程序添加到StartUp注册表时,它会被添加,但当我签入msconfig或taskmgr时,默认情况下它会被禁用。你知道怎么解决这个问题吗?在Windows 8和8.1上测试

   RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
   rk.SetValue("TestApp", Application.ExecutablePath);
   rk.Close();
我是否应该尝试在shell中创建一个快捷方式:startup? 谢谢你的帮助