我想從我的FolderBrowserDialog.SelectedPath()保存一個字符串變量。將一個字符串保存到一個.setting變量
使用斷點我可以看到該字符串已正確加載到SelectedPath()上,但我無法將該字符串保存到.settings文件中以用於我的生活。任何幫助?
public void LocateWoWFolder()
{
using (FolderBrowserDialog FileDialogWindow = new FolderBrowserDialog())
{
if (FileDialogWindow.ShowDialog() == DialogResult.OK)
{
//Using a breakpoint here I can see that nothing is loaded to .WoWFolderLocation.
Properties.Settings.Default.WoWFolderLocation = FileDialogWindow.SelectedPath.ToString();
}
}
}
設置WoWFolderLocation是字符串類型,並且是用戶範圍設置。我究竟做錯了什麼? :P
請參閱http://stackoverflow.com/questions/1282748/my-app-config-file-isnt-saving-anything-i-modify/1282833#1282833。 – 2009-08-16 01:39:16