1

I am trying to insert in Settings.settings a special folder path (MyDocuments). I currently use this: Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) but hardcoded. I don't want to have it hardcoded, so I've decided to move it to Settings.settings. Here, I have to choose a Type but I can't find an appropriate type for a code sequence. What type should I use, so that it will be interpreted in code syntax? Thank you! :)

private void LoadTemplateButton_Click(object sender, RoutedEventArgs e) {
            //select template file via dialog
            Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\NEWFOLDER");

            System.Windows.Forms.OpenFileDialog fileSelectDialog = new System.Windows.Forms.OpenFileDialog {
                Multiselect = false,
                InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\\NEWFOLDER"
            };
        }
Rares
  • 11
  • 2

0 Answers0