开发者

How to auto start a winform application programmatically in c#?

开发者 https://www.devze.com 2023-03-27 05:51 出处:网络
I have a C# Windows Form Application 开发者_C百科that has settings, in the settings window I\'ll have a check box witch indicates that my application should start automatically after windows start-up

I have a C# Windows Form Application 开发者_C百科that has settings, in the settings window I'll have a check box witch indicates that my application should start automatically after windows start-up or not. I need to set and unset this future programmatically in c#. What is the simplest way to do this ?


To auto-run your program at windows startup you want to add your application to the registry key at:

hkcu\Software\Microsoft\Windows\CurrentVersion\Run

There will be other keys there; take a look in regedit to see examples of what yours needs to look like.

You can add or remove a key there with the registry class:

http://msdn.microsoft.com/en-us/library/h5e7chcf.aspx


one option would be http://simpcode.blogspot.com/2008/07/c-set-and-unset-auto-start-for-windows.html

0

精彩评论

暂无评论...
验证码 换一张
取 消