C# 作为windows应用程序运行.net core应用程序,并在windows启动时启动
我已经用.NETCore2.2编写了应用程序 我想像windows应用程序一样运行它,并在windows启动时启动 下面是我如何使其作为Windows应用程序运行的C# 作为windows应用程序运行.net core应用程序,并在windows启动时启动,c#,.net,windows,.net-core,C#,.net,Windows,.net Core,我已经用.NETCore2.2编写了应用程序 我想像windows应用程序一样运行它,并在windows启动时启动 下面是我如何使其作为Windows应用程序运行的 如何使其在windows start下运行?您在这里有多个选项 一种是添加注册表项。(您应该对此有权限) RegistryKey registryKeyk=Registry.CurrentUser.OpenSubKey (“软件\\Microsoft\\Windows\\CurrentVersion\\Run”,true) reg
如何使其在windows start下运行?您在这里有多个选项
RegistryKey registryKeyk=Registry.CurrentUser.OpenSubKey
(“软件\\Microsoft\\Windows\\CurrentVersion\\Run”,true)代码>
registryKeyk.SetValue(“AppName”,Application.ExecutablePath)代码>
这里有多个选项
RegistryKey registryKeyk=Registry.CurrentUser.OpenSubKey
(“软件\\Microsoft\\Windows\\CurrentVersion\\Run”,true)代码>
registryKeyk.SetValue(“AppName”,Application.ExecutablePath)代码>
我需要在哪里设置注册表项?我知道我的意思是Program.cs文件在哪里,或者Application.ExecutablePath在哪里,它是什么名称空间?System.Windows.FormsOkay,所以第一个变量将使我的应用程序在开始时自动运行?我需要在哪里设置注册表项?我知道我的意思是Program.cs文件在哪里,或者在哪里?
Application.ExecutablePath
,它是什么名称空间?System.Windows.FormsOkay,那么第一个变量将使我的应用程序在开始时自动运行?