Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configuration file issue

Status
Not open for further replies.

ashishraj14

Programmer
Mar 1, 2005
92
AU
How can I make my application to expect config file under "C:\Documents and
Settings\All Users\Application Data\MyApplication" folder rather install
folder.

My app performs read/write operation on application configuration file that
gets installed under application folder "c:\program files\My Application". It
works alright on XP, but as soon as I run it on VISTA machine, I start
hitting virtualization & UAC issues.

How can make my app run under VISTA? Can I move the config file under
"C:\Documents and Settings\All Users\Application Data" folder? If yes, how
can I make my app to expect config file under "C:\Documents and Settings\All
Users\Application Data" rather app folder.

Thanks
 
If you are using .Net 2.0 or higher and Visual Studio 2005 or 2008 then you can simply use the Settings.Settings file and change each value from "Application" to "User" where it will take care of the config files for you.

If you are reading/writing your own config files manually then you will want to look at the System.Environment static properties


Hope that helps

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top