FolderBrowserDialog.SelectedPath
-
I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)
-
I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)
-
I am designing a Windows Application. In the Settings class of this Application the user has to set a Directory Path to a Software program. I created a browsing button With the "FolderBrowserDialog" and with "FolderBrowserDialog.SelectedPath" I show this selected path in a textbox. Now this works, but the "FolderBrowserDialog.SelectedPath" is not remembered by the application when I restart it. How can can I store this SelectedPath? ( I also need this path as a string variable in other Classes)
-
You could store it in the registry. http://www.codeproject.com/cs/system/modifyregistry.asp[^]
Sorry but your link gave me an internal blackout...:~ I just started programming in Visual C# using the Visual Studio manual. Sofar everything was clear, but I got stucked in how to handle my application settings. In the manual I found in the ApplicationSettingsBase this example for saving settings:
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { //Synchronize manual associations first. frmSettings1.FormText = this.Text + '.'; frmSettings1.Save();
so my questions are: 1. Are the ApplicationSettingsBase commands the way to store and reload application settings? 2. If yes: is this applicable to the problem/question in my first message? 3. where should i put this code?