I'm teaching someone better practices by refactoring a large project they worked on. One of the current functions of the application is the option to have the application start when Windows starts. Currently, the application accomplishes this using the Run registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
I haven't had the need to implement this feature before, so I'm not sure if this is the "best" way to make an application run at startup. Is access to this registry key something that most users will have?
Would it be better instead to place a shortcut to the application in the folder indicated by Environment.GetFolderPath(SpecialFolder.Startup)还It seems that creation of shortcuts from .NET is kind of hacky, so I'm not certain this is better.
编辑:
From current responses it's clear that I left out something important. The "start with windows" behavior is optional and part of the options dialog for the program. It's valid (though silly) for the user to toggle it several times while using the application.
It all depends on the intention of the application. If the application is meant for power users, includes an easy way within the program to change that registry key, or is meant as an enterprise solution that shouldn't be removed, the registry key choice is a good one. If it is meant for average users, and has no easy way to change that setting, go with the Startup folder.
In your specific case, using a registry key is perfectly fine, thanks to being able to alter things easily.
一、先尝试cmd 输入: cd %windir%\system32 命令按回车键。这个命令的意思是说找到system32文件夹路径。 再输入: Regsvr32 Msxml3.dll 再按回车键执行,这个过程运行完毕需要等待一段时间 二、兼容性 若还没解决,考虑兼容性问题 右键点击该程序在桌面上的图标,选择“属性”。在弹出的窗口上选择“兼容性...
IDEA 启动 Tomcat 服务时显示 It is possible to bind and connect to localhost:8080 at the same time - application server will probably compete with some other software on the port 可以同时绑定并连接到本地主机:8080—&md...
线程问题:This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.  ...
线程问题:This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes. (大致意思是我避开了主线...
背景: redis字典(hash表)当数据越来越多的时候,就会发生扩容,也就是rehash 对比:java中的hashmap,当数据数量达到阈值的时候(0.75),就会发生rehash,hash表长度变为原来的二倍,将原hash表数据全部重新计算hash地址,重新分配位置,达到rehash目的 redis中的hash表采用的是渐进式hash的方式: 1、redis字典(hash表)底层有...
2019独角兽企业重金招聘Python工程师标准>>> 我们平时按下键盘上的‘回车键’,就能实现回车换行【我们在屏幕上所看到的就是光标移到了下一行的开头位置!!ps:不讨论软件实现的特殊功能,如word里的回车智能缩进】。因此对这个按键更准确说应该叫做‘回车换行键’ 就且将这种将光标移到下行开...
首先,在Windows操作系统下安装python,完成python环境的搭建。(我看有的博客需要配置环境变量,其实不必要,因为我们在安装的时候只要勾选如下图所示即可避免不必要的麻烦) 第二步,使用快捷键windows+R或者点击如下图所示,之后点击运行 在其中输入cmd即可进入dos命令。 第三步,输入以下命令 就会自动安装,等待安装完成即可。 第四步,检测django是否安装成功,如果出现如下图...
做过项目的童鞋可能都使用过日志功能,以便有异常错误能够快速跟踪、定位,Qt也提供的类似的机制。之前用Qt4做项目时使用的是Qt::qInstallMsgHandler(),到了Qt5,使用了新的Qt::qInstallMessageHandler()来替代,详情请查看Qt助手(C++ API changes)。 描述 助手中在C++ API ...
版权声明:本套技术专栏是作者(秦凯新)平时工作的总结和升华,通过从真实商业环境抽取案例进行总结和分享,并给出商业应用的调优建议和集群环境容量规划等内容,请持续关注本套博客。QQ邮箱地址:[email protected],如有任何学术交流,可随时联系。 1 数据的预处理分析 2 数据标准化处理 3 sklearn多模型封装(已废弃,学思想) 4 阈值概率调整 5 总结 方便复习,整成笔记,内容粗略...
最近在跑公司的项目的过程中我发现,当一个tomcat中运行多个项目的时候,就会报这个错误。我以前由于使用Maven-tomcat插件方式运行项目,所有没有遇到过这种情况。 自己查了一下资料,但是后来我发现有些帖子中描述的解决方法:window–preferences—tomcat—JVM Setting ——append to J...
I have a dataframe and i want to calculate the sum of variables present in a vector in every row and make the sum in other variable after i want the name of new variable created to be from the name of...
I have a very rough project that done partially in zend framework (not ZF2). The 'application', 'library' and 'public' folders are on the same root. Now i need to create a library 'Anil' in the 'libra...
I want to hide some of the categories from magento home page. I have created some categories like New Arrivals, Special Offer Which I would like to show in some different way may be in left panel or r...
I am writing to an internal file in Android Studio The code lets me write lines of data split with commas. I am able to then go to another activity and read it all out at once. However I want to be ab...
I'm new to Ruby On Rails, I used the acts_as_votable gem to create Like and Unlike Buttons to make Users like and unlike Posts but I can't make them change from Like to Unlike (and viceversa) and upda...