The Media Center Sandbox

Resources and discussion for developing experiences in the Windows Media Center platform.
Welcome to The Media Center Sandbox Sign in | Join | Help
in Search

Configuration data for add-in

Last post 08-18-2008, 4:34 PM by James. 3 replies.
Sort Posts: Previous Next
  •  08-18-2008, 10:16 AM 8126

    Configuration data for add-in

    Quick question, where is the right place to put configuration data that I want to read from my add-in? 
  •  08-18-2008, 10:52 AM 8127 in reply to 8126

    Re: Configuration data for add-in

    Is it per-user data or per-machine data?   For per-user data I use C:\Users\<user>\AppData\Roaming and for per-machine data I use C:\ProgramData.

    These folders can be accessed using the Environment.SpecialFolder enumeration so you don't even need to know where they are in your app.

    Alternatively you can use the "Settings" feature in VS2008 which will store your settings in an XML file for you, that you can retrieve using the Settings static class.

    Finally, you can store your configuration items in the registry under HKCU\Software or HKLM\Software depending on whether per-user or per-machine data.

    Cheers,
    Andrew

  •  08-18-2008, 10:58 AM 8128 in reply to 8127

    Re: Configuration data for add-in

    Perfect.. thanks!
  •  08-18-2008, 4:34 PM 8131 in reply to 8126

    Re: Configuration data for add-in

    Just a quick warning: you won't be able to write to HKLM\Software from within an addin when the user is running a standard setup - the account privileges are insufficient.
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems