我编写了一个简单的C#WPF项目,将数据读入数据网格,然后以CSV格式输出网格内容。 到目前为止,一切正常。
但是,我希望用户可以更改导出位置的文件路径,我也可以这样做,然后“存储”。
我已将默认位置设置为资源中的字符串并可以访问它,但是如果用户更改了资源字符串,我不知道如何更新资源字符串。
FilePath = ExportBonusToCSV_v1.Properties.Resources.ExportPath; MessageBox.Show(FilePath);可以这样做还是有更好的方法?
I have written a simple C# WPF project to read data into a datagrid and then output the contents of grid as a CSV. This all works fine, so far.
However, I want the file path of the export location to be changed by the user, which again I can do, and then "stored".
I have set the default location a string in resources and can access it, but I do not know how to update the resource string if the users changes it.
FilePath = ExportBonusToCSV_v1.Properties.Resources.ExportPath; MessageBox.Show(FilePath);Can this be done or is there a better way?
最满意答案
您可以使用独立存储来保留用户设置。
如果您不知道这是什么,以下内容可能会帮助您入门:
“它是什么?” - 在InformIT上输入文章 MSDN文档You can use Isolated Storage to persist user settings.
In case that you don't know what that is, the following might help you get started:
"What is it?"-type article on InformIT MSDN documentation更多推荐
发布评论