Click here to Skip to main content
15,908,673 members
Home / Discussions / C#
   

C#

 
GeneralRe: Inserting Multiple Rows in a single column Pin
Imranlogi24-Jan-08 20:12
Imranlogi24-Jan-08 20:12 
GeneralLapse in Window Service Pin
Member 78161024-Jan-08 15:30
Member 78161024-Jan-08 15:30 
GeneralRe: Lapse in Window Service Pin
Pete O'Hanlon24-Jan-08 16:01
mvePete O'Hanlon24-Jan-08 16:01 
GeneralRe: Lapse in Window Service Pin
Member 78161024-Jan-08 18:38
Member 78161024-Jan-08 18:38 
GeneralRe: Lapse in Window Service Pin
Vikram A Punathambekar24-Jan-08 19:59
Vikram A Punathambekar24-Jan-08 19:59 
GeneralRe: Lapse in Window Service Pin
Pete O'Hanlon24-Jan-08 22:19
mvePete O'Hanlon24-Jan-08 22:19 
GeneralRe: Lapse in Window Service Pin
Member 78161024-Jan-08 23:24
Member 78161024-Jan-08 23:24 
QuestionMake a program run at startup? Pin
methhoo24-Jan-08 11:34
methhoo24-Jan-08 11:34 
Hi,
in my program, I want to prepare a choice for user to make the program run when windows starts. (But not when s/he installs the program) I want to make it optional. For that I wrote (when the user checks that option):

string registryaddress = @"Software\Microsoft\Windows\CurrentVersion\Run";
RegistryKey rk = Registry.CurrentUser.OpenSubKey(registryaddress).CreateSubKey("programname");
rk.SetValue("programname",Application.ExecutablePath);


and I get a runtime error as follows :

"Unauthorized access exception " , Cannot write to the registry key...


I need help in this one, and also when the user unchecks this option , I have to delete this registry right?

But the bigger problem occurs when user checks this option but uninstalls the program after that. How can I make the C# Setup Deployement project (I mean the installer) uninstall this registry file, which had not been installed during the installation rather done by the user sometime after.

Thanks.. Sigh | :sigh:
GeneralRe: Make a program run at startup? Pin
Jimmanuel24-Jan-08 12:32
Jimmanuel24-Jan-08 12:32 
QuestionRe: Make a program run at startup? Pin
methhoo25-Jan-08 4:48
methhoo25-Jan-08 4:48 
GeneralRe: Make a program run at startup? Pin
Jimmanuel25-Jan-08 6:20
Jimmanuel25-Jan-08 6:20 
QuestionRe: Make a program run at startup? Pin
methhoo25-Jan-08 7:12
methhoo25-Jan-08 7:12 
GeneralRe: Make a program run at startup? Pin
Jimmanuel25-Jan-08 7:39
Jimmanuel25-Jan-08 7:39 
GeneralRe: Make a program run at startup? Pin
methhoo25-Jan-08 7:45
methhoo25-Jan-08 7:45 
GeneralRe: Make a program run at startup? Pin
methhoo25-Jan-08 7:55
methhoo25-Jan-08 7:55 
GeneralRe: Make a program run at startup? Pin
Jimmanuel25-Jan-08 7:59
Jimmanuel25-Jan-08 7:59 
GeneralRe: Make a program run at startup? Pin
J a a n s24-Jan-08 20:59
professionalJ a a n s24-Jan-08 20:59 
QuestionRe: Make a program run at startup? Pin
methhoo25-Jan-08 4:58
methhoo25-Jan-08 4:58 
Generalselecting table adapters in datasets Pin
Glen Harvy24-Jan-08 11:15
Glen Harvy24-Jan-08 11:15 
GeneralRe: selecting table adapters in datasets Pin
Gareth H24-Jan-08 11:37
Gareth H24-Jan-08 11:37 
GeneralRe: selecting table adapters in datasets Pin
Glen Harvy24-Jan-08 13:23
Glen Harvy24-Jan-08 13:23 
QuestionPrint multiple copies of a page? Pin
DaleEMoore24-Jan-08 10:49
DaleEMoore24-Jan-08 10:49 
GeneralRe: Print multiple copies of a page? Pin
Gareth H24-Jan-08 10:59
Gareth H24-Jan-08 10:59 
GeneralRe: Print multiple copies of a page? Pin
DaleEMoore24-Jan-08 11:22
DaleEMoore24-Jan-08 11:22 
GeneralRe: Print multiple copies of a page? Pin
DaleEMoore24-Jan-08 11:30
DaleEMoore24-Jan-08 11:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.