none
Settings File RRS feed

  • Question

  • Can anyone explain what the following command is used for?  I know if I have a program called test that this command will come back and give me the full path name to the test.settings file.  I looked for this file and even displayed hidden files but there isn't such a file.  I can see the usefullness of the command in giving a full path, but the settings file has me confused.  Where is it and what's it for?  Thanks!  

    File.GetSettingsFilePath()
    Saturday, February 14, 2009 2:05 AM
    Answerer

Answers

  • The Settings file gives you a convenient place to store all your application settings that you want to preserve past the end of the program.

    For example, if you are writing a game and wanted to store the high score, you'd use the settings file.  Here're some relevant snippets of code as to how this would be used.

      settingsFile = File.GetSettingsFilePath()
      hiScore = File.ReadLine(settingsFile, 1)

      If currentScore > hiScore Then
        GraphicsWindow.ShowMessage("Congratulations!  New High Score", "Game")
        File.WriteLine(settingsFile, 1, currentScore)
      EndIf



    • Marked as answer by Dudeson Friday, January 29, 2010 12:07 AM
    Tuesday, February 17, 2009 1:30 AM
    Moderator