Click here to Skip to main content
15,891,375 members
Home / Discussions / C#
   

C#

 
GeneralRe: Registry problem..! Pin
QzRz28-Oct-04 9:45
QzRz28-Oct-04 9:45 
GeneralRe: Registry problem..! Pin
Christian Graus28-Oct-04 9:48
protectorChristian Graus28-Oct-04 9:48 
GeneralRe: Registry problem..! Pin
Alex Korchemniy28-Oct-04 10:04
Alex Korchemniy28-Oct-04 10:04 
GeneralRe: Registry problem..! Pin
Dave Kreskowiak28-Oct-04 16:49
mveDave Kreskowiak28-Oct-04 16:49 
GeneralRe: Registry problem..! Pin
QzRz29-Oct-04 6:19
QzRz29-Oct-04 6:19 
GeneralRe: Registry problem..! Pin
Dave Kreskowiak29-Oct-04 11:34
mveDave Kreskowiak29-Oct-04 11:34 
GeneralRe: Registry problem..! Pin
QzRz29-Oct-04 11:46
QzRz29-Oct-04 11:46 
GeneralRe: Registry problem..! Pin
Dave Kreskowiak29-Oct-04 18:49
mveDave Kreskowiak29-Oct-04 18:49 
My fault. There are a couple of problems, and are easily corrected if you, or I, would read the documentation on the RegistryKey class.
using System.Io;
using Microsoft.Win32;

// Like I said before, DON'T use the Environment.CurrentDirectory.
// There is a large chance that it will not point to the directory
// your .EXE is in!
string path = Path.Combine( Application.StartupPath, "MyApp.exe" );

// Simplify your code a bit.  You don't need to create two variables for this.
// Also, using OpenSubKey with a single string parameter will only open the key
// in Read-Only mode.  You must supply a second parameter set to true, to get
// write access to the subkey.
RegistryKey myKey = Registry.LocalMachine.OpenSubKey( @"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true );
myKey.SetValue( @"MyApp", path );



RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

GeneralRe: Registry problem..! Pin
QzRz29-Oct-04 23:14
QzRz29-Oct-04 23:14 
Generalresponding to javascript in html Pin
JeromeKJerome28-Oct-04 8:02
JeromeKJerome28-Oct-04 8:02 
GeneralRe: responding to javascript in html Pin
Heath Stewart28-Oct-04 15:48
protectorHeath Stewart28-Oct-04 15:48 
GeneralRe: responding to javascript in html Pin
JeromeKJerome28-Oct-04 16:17
JeromeKJerome28-Oct-04 16:17 
GeneralRe: responding to javascript in html Pin
Heath Stewart29-Oct-04 5:28
protectorHeath Stewart29-Oct-04 5:28 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 8:08
JeromeKJerome29-Oct-04 8:08 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 9:27
JeromeKJerome29-Oct-04 9:27 
GeneralRe: responding to javascript in html Pin
JeromeKJerome29-Oct-04 13:41
JeromeKJerome29-Oct-04 13:41 
GeneralRe: responding to javascript in html Pin
Heath Stewart30-Oct-04 3:16
protectorHeath Stewart30-Oct-04 3:16 
GeneralRe: responding to javascript in html Pin
JeromeKJerome1-Nov-04 8:09
JeromeKJerome1-Nov-04 8:09 
GeneralRe: responding to javascript in html Pin
Heath Stewart1-Nov-04 8:11
protectorHeath Stewart1-Nov-04 8:11 
GeneralVisual Studio Add-In C# Pin
Nxsis28-Oct-04 7:54
Nxsis28-Oct-04 7:54 
GeneralRe: Visual Studio Add-In C# Pin
Heath Stewart28-Oct-04 15:40
protectorHeath Stewart28-Oct-04 15:40 
GeneralOffice Programming with C# Pin
Member 140011328-Oct-04 7:02
Member 140011328-Oct-04 7:02 
GeneralRe: Office Programming with C# Pin
Heath Stewart28-Oct-04 15:35
protectorHeath Stewart28-Oct-04 15:35 
GeneralIIS server Pin
ppp00128-Oct-04 6:41
ppp00128-Oct-04 6:41 
GeneralRe: IIS server Pin
Alex Korchemniy28-Oct-04 9:59
Alex Korchemniy28-Oct-04 9:59 

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.