2

Possible Duplicate:
How do I get around application scope settings being read-only?

I have a c# WinForms app that needs to store an application-scoped setting that can also be edited and saved at runtime. In a nutshell, when my application is first launched, it will connect to a web service and retrieve a string which I need to store locally. This string gets sent to the web service in all future communications and is used to identify the particular installation of the software/computer.

The application settings functionality that .NET provides doesn't seem to fit my needs since application-scoped settings are read-only at runtime. My first thought is to create a new folder structure (MyCompanyName\MyApplicationName) below the CommonApplicationData location and write the settings there. Presumably, I'd do this through my installer and then I'd probably need to set the permissions appropriately so all users could read/write to the MyApplicationName folder. Before I head down that path, is there a better way of storing/editing/saving application (not user) scoped settings?

Community
  • 1
  • 1
bmt22033
  • 6,880
  • 14
  • 69
  • 98

1 Answers1

2

I would save the string in Windows Registry under HKEY_LOCAL_MACHINE\SOFTWARE\MYAPP

Stefan P.
  • 9,489
  • 6
  • 29
  • 43