如何保存在程序退出的变量值? [英] How to save variable values on program exit?

查看:121
本文介绍了如何保存在程序退出的变量值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用ArrayList存储变量数量的字符串,并想知道如何保存ArrayList和它的元素,使我的Windows窗体可以调用程序加载和出口之间的价值。

I am trying to use an ArrayList to store a variable number of strings, and would like to know how to save the ArrayList and its elements so that my windows form can recall their value between program load and exit.

我以前存储在一个文本文件中的信息,但想避免外部文件如果可能的话。

I used to store the information in a text file, but would like to avoid external files if possible.

感谢您的帮助,您可以提供。

Thank you for any help you could provide.

推荐答案

您可以保存的ArrayList(如果不是ArrayList的他们的其他等价类)使用的 Properties.Settings 最好的部分是它可以让你在应用程序和用户级别设置变量

You can save the ArrayList (if not ArrayList their are other equivalent classes) using Properties.Settings best part is it allows you the setting variable at Application and user level

一个很好的例子可以在这里找到如何使用Settigns的 HTTP://www.$c$cproject.com/Articles/17659/How-To-Use-the-Settings-Class-in-C

A very good example can be found here how to use Settigns http://www.codeproject.com/Articles/17659/How-To-Use-the-Settings-Class-in-C

这篇关于如何保存在程序退出的变量值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆