Created
February 15, 2011 14:50
-
-
Save emad-elsaid/827606 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /*first: you need to add the following to the head of your file to link with Windows library.*/ | |
| using Microsoft.Win32; | |
| /* second you'll nedd to make a new object of the folder of current user registery */ | |
| RegistryKey rkApp = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); | |
| /* third you have to add your application key : name and path */ | |
| rkApp.SetValue("HappyV", Application.ExecutablePath.ToString()); | |
| /* that line is to remove your application from the registery */ | |
| rkApp.DeleteValue("HappyV", false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment