Khởi Động Cùng Win
Visual C# Code:
namespace RunAtStartup { { // The path to the key where Windows looks for startup applications [B]RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);[/B] { InitializeComponent(); // Check to see the current state (running at startup or not) { // The value doesn't exist, the application is not set to run at startup } { // The value exists, the application is set to run at startup } } { { // Add the value in the registry so that the application runs at startup [B]rkApp.SetValue("MyApp", Application.ExecutablePath.ToString());[/B] } { // Remove the value from the registry so that the application doesn't start } } } }