How to make an application automatically start at Windows start?
I am new to .NET, I have made a small app. I want th开发者_如何学编程at this app should start when we start Windows, also how to make this app be present like a system tray icon if we minimize it. The app is a Windows form application.
As far as having it start automatically you can make it a windows service or you can simply place it in the windows startup folder and it will automatically launch it. For the System tray you should look into the NotifyIcon control.
For starting: couple of options..
1: Use scheduled tasks - accessed through control panel / adminstrative tasks 2: Make a shortcut to your exe in the startup folder in your start menu
For system tray: refer to this question: What's the proper way to minimize to tray a C# WinForms app?
in addition to what @Jesus said
you can also add a registry entry for start up. Windows service wouldn't do if your app is requiring the tray icon.
Best bet IMO is to make an installer project and configure the installer to have it start with windows when it's installed. Let the installer figure it out.
精彩评论