Stupid Question

ZeroEffect

Well-known member
Joined
Oct 24, 2004
Messages
180
Location
Detroit, MI
I know how to save settings to the registry, but what I want do is save it to a location based on the name my programs name. So if I have more than two instancies running pro1.exe and pro2.exe the settings would be saved to pro1 and pro2 so there wouldnt be any conflicts.

I know it is a lame question but the thoughs I have come up with have two many holes.

Thanks for any thought you may have.

Zeroeffect
 
Sorry about that. Here is the code I use...

Code:
SaveSetting(Application.ProductName, "Setting", "Setting Name", "Setting Value")

I need/want "Application.ProductName" to be the name of the EXE file.
This would allow more than one instance of the program to run
Each with thier own settings.

I could use a cfg file but Id like to use the registry

Thanks,

ZeroEffect
 
Have you tried using
Code:
System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath)

Is there any reason why you would prefer to use the registry bearing in mind that makes it not portable, harder to transfer and MS themselves recommend against it?
 
PlausiblyDamp said:
Have you tried using
Code:
System.IO.Path.GetFileNameWithoutExtension(Application.ExecutablePath)

Is there any reason why you would prefer to use the registry bearing in mind that makes it not portable, harder to transfer and MS themselves recommend against it?

I havent tried that yet. I know its not the smartest way of dealing with settings. I personally like the config class I have, but this with match the main programs way of handeling settings.

Ill give your piece of code a try and see what happens.

Thanks dor your help.

ZeroEffect
 
Back
Top